-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
88 lines (82 loc) · 2.72 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
version: '2'
services:
db:
image: kartoza/postgis:9.6-2.4
volumes:
- ~/postgres_data/geoserver:/var/lib/postgresql
geoserver:
image: mapseed/geoserver:release-1.0.4
volumes:
- ~/geoserver_data:/opt/geoserver/data_dir
- ./setenv.sh:/usr/local/tomcat/bin/setenv.sh
# ports:
# - "8080:8080"
links:
- db:db
s3-sync:
image: mapseed/geoserver-data-sync:release-1.0.2
volumes:
- ~/geoserver_data:/geoserver_data
environment:
- USERNAME=${SYNC_USERNAME}
- PASSWORD=${SYNC_PASSWORD}
- GEOSERVER_DATA_DIR=${SYNC_GEOSERVER_DATA_DIR}
- S3_BUCKET=${SYNC_S3_BUCKET}
- AWS_ACCESS_KEY_ID=${SYNC_AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${SYNC_AWS_SECRET_ACCESS_KEY}
command: sh -c "git stash && git fetch && git checkout s3-sync && git pull --rebase && ./start.sh"
letsencrypt:
image: certbot/certbot
entrypoint: "sh"
volumes:
- /etc/letsencrypt:/etc/letsencrypt
- /var/lib/letsencrypt:/var/lib/letsencrypt
- ./run-letsencrypt.sh:/run-letsencrypt.sh
ports:
- "80"
- "443"
environment:
- TERM=xterm
- LETSENCRYPT_DOMAINS=${LETSENCRYPT_DOMAINS}
- LETSENCRYPT_DEBUG_MODE=${LETSENCRYPT_DEBUG_MODE}
- LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
command: "/run-letsencrypt.sh"
# # For local testing only:
# nginx:
# image: nginx:stable-alpine
# volumes:
# - ./nginx-envsubst.conf:/etc/nginx/nginx.conf
# links:
# - smartercleanup-api
# volumes_from:
# - smartercleanup-api
# ports:
# - 80:80
# restart: always
nginx:
image: lukeswart/nginx-letsencrypt
volumes:
- ./nginx-acme-challenge-envsubst.conf:/etc/nginx/nginx.conf
- ./nginx-envsubst.conf:/etc/nginx/nginx-secure.conf
links:
- geoserver
- s3-sync
volumes_from:
# - geoserver
- letsencrypt
environment:
- MY_DOMAIN_NAME=${MY_DOMAIN_NAME}
ports:
- 80:80
- 443:443
restart: always
# Our cron container that runs our letsencrypt container, and reloads our nginx container
letsencrypt-nginx-cron:
image: docker:17.10
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./letsencrypt-nginx-cron:/etc/cron.d/letsencrypt-nginx-cron
# environment:
# - TZ=${TZ}
# TODO: automate timezone script
command: sh -c "apk add --update tzdata && cp /usr/share/zoneinfo/US/Pacific /etc/localtime && echo 'America/Los_Angeles' > /etc/timezone && date && apk del tzdata && chmod a+x /etc/cron.d/letsencrypt-nginx-cron && touch /var/log/crond.log && crontab /etc/cron.d/letsencrypt-nginx-cron && crond -l 0 -L /var/log/crond.log && echo 'starting nginx-cron' && tail -f /var/log/crond.log"