Skip to content

Commit 8048db4

Browse files
committedMar 31, 2017
set timezone
1 parent 15390ad commit 8048db4

File tree

4 files changed

+53
-43
lines changed

4 files changed

+53
-43
lines changed
 

‎Dockerfile

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ ENV RESTYABOARD_VERSION=v0.4.2 \
77
SMTP_USERNAME=root \
88
SMTP_PASSWORD=root \
99
SMTP_SERVER=localhost \
10-
SMTP_PORT=465
10+
SMTP_PORT=465 \
11+
TZ=Etc/UTC
1112

1213
# update & install package
1314
RUN apt-get update && \
@@ -68,7 +69,7 @@ RUN rm /etc/nginx/sites-enabled/default && \
6869
RUN apt-get autoremove -y --purge && \
6970
apt-get clean
7071

71-
# entry point
72+
# entrypoint
7273
COPY docker-entrypoint.sh /
7374
RUN chmod +x /docker-entrypoint.sh
7475
ENTRYPOINT ["/docker-entrypoint.sh"]

‎README.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,28 @@ Docker Restyaboard
33

44
Trello like kanban board. http://restya.com/board/
55

6+
TL;DR
7+
-----
8+
9+
```bash
10+
git clone https://github.com/cangeli/docker-restyaboard
11+
cd docker-restyaboard
12+
git checkout alpine
13+
docker-compose up -d
14+
```
15+
http://127.0.0.1:1234
16+
```
17+
Username: admin
18+
Password: restya
19+
```
20+
621
docker-compose.yml
722
------------------
823
```
924
version: '2'
1025
services:
1126
restyaboard:
12-
image: cangeli/docker-restyaboard:0.4.2
27+
image: cangeli/docker-restyaboard:alpine
1328
ports:
1429
- 1234:80
1530
volumes:
@@ -23,7 +38,7 @@ services:
2338
- postgres
2439
restart: always
2540
postgres:
26-
image: postgres:9.6
41+
image: kiasaki/alpine-postgres
2742
ports:
2843
- 5432:5432
2944
environment:

‎docker-compose.yml

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
version: '2'
2-
32
services:
4-
53
restyaboard:
64
build: .
75
ports:
@@ -18,12 +16,10 @@ services:
1816
- SMTP_PASSWORD=pass
1917
- SMTP_SERVER=server
2018
- SMTP_PORT=465
19+
- TZ=Etc/UTC
2120
depends_on:
2221
- postgres
23-
networks:
24-
- restya-net
2522
restart: always
26-
2723
postgres:
2824
image: postgres:9.6
2925
ports:
@@ -33,9 +29,4 @@ services:
3329
- POSTGRES_USER=admin
3430
- POSTGRES_PASSWORD=admin
3531
- POSTGRES_DB=restyaboard
36-
networks:
37-
- restya-net
3832
restart: always
39-
40-
networks:
41-
restya-net:

‎docker-entrypoint.sh

+32-29
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,44 @@ set -e
44
if [ "$1" = 'start' ]; then
55

66
# config
7-
sed -i "s/^.*'R_DB_HOST'.*$/define('R_DB_HOST', '${POSTGRES_HOST}');/g" \
8-
${ROOT_DIR}/server/php/config.inc.php
9-
sed -i "s/^.*'R_DB_PORT'.*$/define('R_DB_PORT', '5432');/g" \
10-
${ROOT_DIR}/server/php/config.inc.php
11-
sed -i "s/^.*'R_DB_USER'.*$/define('R_DB_USER', '${POSTGRES_USER}');/g" \
12-
${ROOT_DIR}/server/php/config.inc.php
13-
sed -i "s/^.*'R_DB_PASSWORD'.*$/define('R_DB_PASSWORD', '${POSTGRES_PASSWORD}');/g" \
14-
${ROOT_DIR}/server/php/config.inc.php
15-
sed -i "s/^.*'R_DB_NAME'.*$/define('R_DB_NAME', '${POSTGRES_DB}');/g" \
16-
${ROOT_DIR}/server/php/config.inc.php
7+
sed -i \
8+
-e "s/^.*'R_DB_HOST'.*$/define('R_DB_HOST', '${POSTGRES_HOST}');/g" \
9+
-e "s/^.*'R_DB_PORT'.*$/define('R_DB_PORT', '5432');/g" \
10+
-e "s/^.*'R_DB_USER'.*$/define('R_DB_USER', '${POSTGRES_USER}');/g" \
11+
-e "s/^.*'R_DB_PASSWORD'.*$/define('R_DB_PASSWORD', '${POSTGRES_PASSWORD}');/g" \
12+
-e "s/^.*'R_DB_NAME'.*$/define('R_DB_NAME', '${POSTGRES_DB}');/g" \
13+
${ROOT_DIR}/server/php/config.inc.php
14+
echo $TZ > /etc/timezone
15+
rm /etc/localtime
16+
cp /usr/share/zoneinfo/$TZ /etc/localtime
17+
sed -i "s|;date.timezone = |date.timezone = ${TZ}|" /etc/php/7.0/fpm/php.ini
1718

1819
# postfix
1920
echo "[${SMTP_SERVER}]:${SMTP_PORT} ${SMTP_USERNAME}:${SMTP_PASSWORD}" > /etc/postfix/sasl_passwd
2021
postmap /etc/postfix/sasl_passwd
2122
echo "www-data@${SMTP_DOMAIN} ${SMTP_USERNAME}" > /etc/postfix/sender_canonical
2223
postmap /etc/postfix/sender_canonical
23-
sed -i '/mydomain.*/d' /etc/postfix/main.cf
24-
sed -i '/myhostname.*/d' /etc/postfix/main.cf
25-
sed -i '/myorigin.*/d' /etc/postfix/main.cf
26-
sed -i '/mydestination.*/d' /etc/postfix/main.cf
27-
sed -i "$ a mydomain = ${SMTP_DOMAIN}" /etc/postfix/main.cf
28-
sed -i "$ a myhostname = localhost" /etc/postfix/main.cf
29-
sed -i '$ a myorigin = $mydomain' /etc/postfix/main.cf
30-
sed -i '$ a mydestination = localhost, $myhostname, localhost.$mydomain' /etc/postfix/main.cf
31-
sed -i '$ a sender_canonical_maps = hash:/etc/postfix/sender_canonical' /etc/postfix/main.cf
32-
sed -i "s/relayhost =.*$/relayhost = [${SMTP_SERVER}]:${SMTP_PORT}/" /etc/postfix/main.cf
33-
sed -i '/smtp_.*/d' /etc/postfix/main.cf
34-
sed -i '$ a smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache' /etc/postfix/main.cf
35-
sed -i '$ a smtp_sasl_auth_enable = yes' /etc/postfix/main.cf
36-
sed -i '$ a smtp_sasl_security_options = noanonymous' /etc/postfix/main.cf
37-
sed -i '$ a smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd' /etc/postfix/main.cf
38-
sed -i '$ a smtp_use_tls = yes' /etc/postfix/main.cf
39-
sed -i '$ a smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt' /etc/postfix/main.cf
40-
sed -i '$ a smtp_tls_wrappermode = yes' /etc/postfix/main.cf
41-
sed -i '$ a smtp_tls_security_level = encrypt' /etc/postfix/main.cf
24+
sed -i \
25+
-e '/mydomain.*/d' \
26+
-e '/myhostname.*/d' \
27+
-e '/myorigin.*/d' \
28+
-e '/mydestination.*/d' \
29+
-e "$ a mydomain = ${SMTP_DOMAIN}" \
30+
-e "$ a myhostname = localhost" \
31+
-e '$ a myorigin = $mydomain' \
32+
-e '$ a mydestination = localhost, $myhostname, localhost.$mydomain' \
33+
-e '$ a sender_canonical_maps = hash:/etc/postfix/sender_canonical' \
34+
-e "s/#relayhost =.*$/relayhost = [${SMTP_SERVER}]:${SMTP_PORT}/" \
35+
-e '/smtp_.*/d' \
36+
-e '$ a smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache' \
37+
-e '$ a smtp_sasl_auth_enable = yes' \
38+
-e '$ a smtp_sasl_security_options = noanonymous' \
39+
-e '$ a smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd' \
40+
-e '$ a smtp_use_tls = yes' \
41+
-e '$ a smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt' \
42+
-e '$ a smtp_tls_wrappermode = yes' \
43+
-e '$ a smtp_tls_security_level = encrypt' \
44+
/etc/postfix/main.cf
4245

4346
# init db
4447
export PGHOST=${POSTGRES_HOST}

0 commit comments

Comments
 (0)
Please sign in to comment.