Browse Source

Set config timezone

Kévio Castro 11 years ago
parent
commit
2e58900842
3 changed files with 6 additions and 2 deletions
  1. 3 1
      Dockerfile
  2. 2 0
      README.md
  3. 1 1
      docker_config/php.ini

+ 3 - 1
Dockerfile

@@ -1,4 +1,5 @@
 FROM php:5.6-apache
+COPY . /elgg-docker/
 COPY docker_config/php.ini /usr/local/etc/php/
 
 RUN apt-get update && apt-get install -y \
@@ -21,6 +22,8 @@ RUN a2enmod rewrite
 #Set time zone in server
 ENV TIMEZONE="America/Sao_Paulo"
 RUN cp /usr/share/zoneinfo/${TIMEZONE} /etc/localtime
+#Set time zone in PHP
+RUN sed -i "s#{{timezone}}#$TIMEZONE#g" /usr/local/etc/php/php.ini
 
 # set defaults or env vars for Elgg and MySQL
 # MySQL
@@ -50,5 +53,4 @@ ENV ELGG_PATH=${ELGG_PATH:-"/var/www/html/"}
 # 2 is ACCESS_PUBLIC
 ENV ELGG_SITE_ACCESS=${ELGG_SITE_ACCESS:-"2"}
 
-COPY . /elgg-docker/
 RUN chmod +x /elgg-docker/elgg-install.sh

+ 2 - 0
README.md

@@ -103,8 +103,10 @@ web:
     MYSQL_PASS: elgg-pass
     ELGG_DISPLAY_NAME: my-name
     ELGG_DB_PREFIX: my-elgg
+    TIMEZONE: America/Sao_Paulo
 ```
 
+* `TIMEZONE` The timezone of the server and php 
 * `MYSQL_USER` The DB username to create
 * `MYSQL_PASS` The DB password to set on the created user
 * `ELGG_DB_HOST` The DB host Elgg will use

+ 1 - 1
docker_config/php.ini

@@ -1 +1 @@
-date.timezone = "America/Sao_Paulo"
+date.timezone = "{{timezone}}"