forked from TaiBIF/portal20
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-production.yml
76 lines (74 loc) · 2.16 KB
/
docker-compose-production.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
version: '3.7'
services:
web:
build: .
container_name: taibif-web-container
image: taibif-web-image
expose:
- 8001
depends_on:
- db
links:
- db:db
volumes:
- .:/taibif-code
- ../taibif-volumes/static:/taibif-volumes/static
- ../taibif-volumes/media:/taibif-volumes/media
- ../taibif-volumes/bucket:/taibif-bucket
- ../taibif-volumes/logs/web:/taibif-code/logs
command: "./scripts/wait-for-it.sh db:5432 -t 30 -- ./scripts/docker-web-entry.sh"
#command: ./docker-web-entry.sh
restart: always
env_file:
- .env
db:
container_name: taibif-db-container
image: postgres:12-alpine
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=example
- POSTGRES_DB=taibif
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- ../taibif-volumes/pgdata:/var/lib/postgresql/data/pgdata
- ../taibif-volumes/bucket:/taibif-bucket
php:
#image: php:5.6-zts-jessie
image: php:5.6.40-fpm-alpine
#build: .
tty: true
#ports:
# - 8000:80
volumes:
- ./php_build/src:/php_code
#- ./php.ini:/usr/local/etc/php/php.ini
nginx:
image: nginx:1.17.6-alpine
restart: always
ports:
- 80:80
- 443:443
volumes:
- ./php_build/src:/php_code
- ./nginx/production:/etc/nginx/conf.d
- ../taibif-volumes/static:/taibif-volumes/static
- ../taibif-volumes/media:/taibif-volumes/media
- ../taibif-volumes/logs/nginx:/var/log/nginx
- ../taibif-volumes/certbot/conf:/etc/letsencrypt
- ../taibif-volumes/certbot/www:/var/www/certbot
links:
- web:web
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "3"
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/certbot
restart: unless-stopped
volumes:
- ../taibif-volumes/certbot/conf:/etc/letsencrypt
- ../taibif-volumes/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"