File tree 6 files changed +34
-1
lines changed
6 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 1
1
# dora changelog
2
2
3
+ ## Version 1.2.0 (2020-03-06)
4
+
5
+ ### New feature
6
+
7
+ - Configure the container's time zone using the ` $TIMEZONE ` environment
8
+ variable.
9
+
3
10
## Version 1.1.0 (2020-03-06)
4
11
5
12
### New feature
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ ENV RAILS_DB_HOST ""
17
17
ENV RAILS_DB_NAME ${APP_NAME}
18
18
ENV RAILS_DB_USER ${APP_NAME}
19
19
ENV RAILS_DB_PASS ""
20
+ ENV TIMEZONE="UCT"
20
21
ENV WKHTMLTOPDF ""
21
22
ENV WKHTMLTOPDF_URL "https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb"
22
23
ENV WKHTMLTOPDF_SUM "db48fa1a043309c4bfe8c8e0e38dc06c183f821599dd88d4e3cea47c5a5d4cd3"
@@ -30,7 +31,8 @@ RUN /pd_build/nodejs.sh
30
31
# Install yarn
31
32
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - &&\
32
33
echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list &&\
33
- apt-get update && apt-get install yarn
34
+ apt-get update &&\
35
+ apt-get install -y --no-install-recommends yarn tzdata
34
36
35
37
# This is from passenger-docker's README.
36
38
ENV HOME /root
@@ -57,6 +59,8 @@ ADD bootstrap-container.sh /etc/my_init.d/10_bootstrap_container.sh
57
59
RUN chmod +x /etc/my_init.d/10_bootstrap_container.sh
58
60
ADD install-wkhtmltopdf.sh /etc/my_init.d/90_install_wkhtmltopdf.sh
59
61
RUN chmod +x /etc/my_init.d/90_install_wkhtmltopdf.sh
62
+ ADD set-timezone.sh /etc/my_init.d/01_set_timezone.sh
63
+ RUN chmod +x /etc/my_init.d/01_set_timezone.sh
60
64
61
65
RUN mkdir -p /etc/service/sidekiq
62
66
ADD run-sidekiq.sh /etc/service/sidekiq/run
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ Customization is mostly done with environment variables.
42
42
| ` RAILS_SMTP_USER ` | SMTP user name | ` $APP_NAME `
43
43
| ` RAILS_SMTP_PASS ` | SMTP password |
44
44
| ` SECRET_KEY_BASE ` | Rails' secret key base |
45
+ | ` TIMEZONE ` | Time zone of the container | ` UCT `
45
46
| ` NO_WKHTMLTOPDF ` | Do not attempt to install [ wkhtmltopdf] [ ] | (empty)
46
47
| ` WKHTMLTOPDF_URL ` | Download URL for [ wkhtmltopdf] [ ] |
47
48
@@ -332,6 +333,19 @@ via environment variables. A `.env` file lends itself well to this
332
333
configuration. The composition consists of the rails app, Postgres, and Redis.
333
334
See `sample.env` for usage instructions.
334
335
336
+ # # Container time zone
337
+
338
+ ` passenger-docker` does not configure a time zone for the container. Dora does
339
+ do it by installing the `tzdata` package and supporting a `$TIMEZONE` variable.
340
+ This variable _must_ be set to a directory and file unter `/usr/share/zoneinfo`,
341
+ e.g. `Europe/Berlin`.
342
+
343
+ To see all possible values for `$TIMEZONE`, issue :
344
+
345
+ ` ` ` bash
346
+ find /usr/share/zoneinfo -follow | sed -E 's_(/[^/]+){3}/__'
347
+ ` ` `
348
+
335
349
# # Troubleshooting
336
350
337
351
# ## Sending mail
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ services:
24
24
- RAILS_DB_NAME
25
25
- RAILS_DB_USER
26
26
- RAILS_DB_PASS
27
+ - TIMEZONE
27
28
depends_on :
28
29
- db
29
30
- redis
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ echo "= RAILS_DB_PASS: $RAILS_DB_PASS"
29
29
echo " = RAILS_SMTP_HOST: $RAILS_SMTP_HOST "
30
30
echo " = RAILS_SMTP_USER: $RAILS_SMTP_USER "
31
31
echo " = RAILS_SMTP_PASS: $RAILS_SMTP_PASS "
32
+ echo " = TIMEZONE: $TIMEZONE "
32
33
echo " = NO_WKHTMLTOPDF: $NO_WKHTMLTOPDF "
33
34
echo " = \` which wkhtmltopdf\` : $( which wkhtmltopdf) "
34
35
echo
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ if [ " $TIMEZONE " != " " ]; then
4
+ echo " Setting time zone to $TIMEZONE "
5
+ ln -sf " /usr/share/zoneinfo/$TIMEZONE " /etc/localtime
6
+ fi
You can’t perform that action at this time.
0 commit comments