-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml.default
106 lines (99 loc) · 3.18 KB
/
docker-compose.yaml.default
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
version: '3'
services:
nginx:
image: nginx:alpine
depends_on:
- php
restart: always
tty: false
ports:
- "80:80"
- "443:443"
volumes:
# Nginx
- ./docker/nginx/nginx.conf:/var/nginx/social.conf
- ./docker/nginx/domain.sh:/var/nginx/domain.sh
# Certbot
- ./docker/certbot/www:/var/www/certbot
- ./docker/certbot/.files:/etc/letsencrypt
# social
- ./public:/var/www/social/public
env_file:
- ./docker/bootstrap/bootstrap.env
- ./docker/db/db.env
command: /bin/sh -c '/var/nginx/domain.sh;
while :; do
sleep 6h & wait $${!};
nginx -s reload;
done &
nginx -g "daemon off;"'
certbot:
image: certbot/certbot
# Check for certificate renewal every 12h as
# recommended by Let's Encrypt
entrypoint: /bin/sh -c 'trap exit TERM;
while :; do
certbot renew > /dev/null;
sleep 12h & wait $${!};
done'
volumes:
- ./docker/certbot/www:/var/www/certbot
- ./docker/certbot/.files:/etc/letsencrypt
php:
image: gsocial/php
restart: always
tty: true
ports:
- 9000:9000
volumes:
# Entrypoint
- ./docker/php/entrypoint.sh:/entrypoint.sh
- ./docker/db/wait_for_db.sh:/wait_for_db.sh
- ./docker/social/install.sh:/var/entrypoint.d/social_install.sh
# Main files
- .:/var/www/social
- /var/www/social/docker # exclude docker folder
env_file:
- ./docker/social/social.env
- ./docker/db/db.env
command: /entrypoint.sh
db:
image: postgres:alpine
restart: always
tty: false
ports:
- 5432:5432
environment:
- PGDATA=/var/lib/postgres/data
env_file:
- ./docker/db/db.env
volumes:
- database:/var/lib/postgres/data
redis:
image: redis:alpine
restart: always
tty: false
volumes:
- ./docker/redis/redis.conf:/etc/redis/redis.conf
ports:
- 6379:6379
command: redis-server /etc/redis/redis.conf
worker:
image: gsocial/php
restart: always
tty: true
volumes:
# Entrypoint
- ./docker/php/entrypoint.sh:/entrypoint.sh
- ./docker/db/wait_for_db.sh:/wait_for_db.sh
- ./docker/social/install.sh:/var/entrypoint.d/social_install.sh
- ./docker/social/worker.sh:/var/entrypoint.d/social_worker.sh
# Main files
- .:/var/www/social
- /var/www/social/docker # exclude docker folder
env_file:
- ./docker/social/social.env
- ./docker/db/db.env
command: /entrypoint.sh
volumes:
database: