This repository has been archived by the owner on Mar 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose-prod.yml
175 lines (160 loc) · 4.32 KB
/
docker-compose-prod.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
version: '3'
services:
app:
build:
context: .
dockerfile: ./docker/app.dockerfile
args:
FPMPORT: 9000
image: hellechat/php
ports:
- "9000"
restart: unless-stopped
tty: true
working_dir: /var/www
volumes:
- ./:/var/www:delegated
- ./docker/php/local.ini:/usr/local/etc/php/conf.d/local.ini
networks:
- app-network
depends_on:
- mysql
qworker:
build:
context: .
dockerfile: ./docker/qworker.dockerfile
restart: unless-stopped
tty: true
working_dir: /etc/supervisor/conf.d
depends_on:
- mysql
- redis
volumes:
- ./:/var/www:delegated
- ./docker/php/local.ini:/usr/local/etc/php/conf.d/local.ini
- ./docker/qworker/horizon.conf:/etc/supervisord.conf
networks:
- app-network
command:
["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"]
cron:
build:
context: .
dockerfile: ./docker/cron.dockerfile
restart: unless-stopped
tty: true
working_dir: /var/www
depends_on:
- mysql
- redis
volumes:
- ./:/var/www:delegated
- ./docker/php/local.ini:/usr/local/etc/php/conf.d/local.ini
networks:
- app-network
command:
["sh", "/run.sh"]
nginx:
image: nginx:alpine
container_name: nginx
depends_on:
- app
- gotify
restart: unless-stopped
tty: true
environment:
GOTIFY_APP_PORT: '${GOTIFY_APP_PORT}'
APP_DOMAIN: '${APP_DOMAIN}'
ports:
- "80:80"
- "443:443"
volumes:
- ./:/var/www
- ./docker/nginx/conf.d/default.template.PROD:/etc/nginx/conf.d/default.template
- ./certbot/www/:/var/www/certbot/:ro
- ./certbot/conf/:/etc/nginx/ssl/:ro
- ./docker/nginx/entrypoint.sh:/entrypoint.sh
networks:
- app-network
entrypoint: ["/entrypoint.sh"]
command: ["nginx", "-g", "daemon off;"]
# Create Certificates manually:
# docker-compose run --rm certbot certonly --webroot --webroot-path /var/www/certbot/ -d example.org
#
# Renew Certificates manually
# docker-compose run --rm certbot renew
# run in host's crontab with nginx reload using:
# 0 */12 * * * cd /var/www && docker-compose run --rm certbot renew && docker exec $(sudo docker ps -f name=nginx -q | head -n1) /usr/sbin/nginx -s reload
certbot:
image: certbot/certbot:latest
depends_on:
- nginx
volumes:
- ./certbot/www/:/var/www/certbot/:rw
- ./certbot/conf/:/etc/letsencrypt/:rw
networks:
- app-network
environment:
APP_DOMAIN: '${APP_DOMAIN}'
APP_DOMAIN_EMAIL: '${APP_DOMAIN_EMAIL}'
#command: certonly --webroot --webroot-path=/var/www/certbot/ --email $APP_DOMAIN_EMAIL --agree-tos --no-eff-email -d $APP_DOMAIN
gotify:
image: gotify/server
depends_on:
- mysql
expose:
- ${GOTIFY_APP_PORT}
- ${GOTIFY_APP_PORT_SSL}
ports:
- "${GOTIFY_APP_PORT}:${GOTIFY_APP_PORT}"
- "${GOTIFY_APP_PORT_SSL}:${GOTIFY_APP_PORT_SSL}"
volumes:
- 'godata:/app/data'
- ./docker/gotify/config.yml:/etc/gotify/config.yml
restart: unless-stopped
networks:
- app-network
environment:
GOTIFY_SERVER_PORT: '${GOTIFY_APP_PORT}'
GOTIFY_SERVER_SSL_PORT: '${GOTIFY_APP_PORT_SSL}'
GOTIFY_DEFAULTUSER_NAME: ${GOTIFY_USERNAME}
GOTIFY_DEFAULTUSER_PASS: ${GOTIFY_PASSWORD}
GOTIFY_DATABASE_DIALECT: 'mysql'
GOTIFY_DATABASE_CONNECTION: '${DB_USERNAME}:${DB_PASSWORD}@tcp(mysql:3306)/gotify?charset=utf8&parseTime=True&loc=Local'
mysql:
image: 'mysql:8.0'
container_name: mysql
restart: unless-stopped
tty: true
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
MYSQL_DATABASE: '${DB_DATABASE}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
volumes:
- 'dbdata:/var/lib/mysql'
networks:
- app-network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
retries: 3
timeout: 5s
redis:
image: redis:6.2
container_name: redis
restart: unless-stopped
ports:
- "6379:6379"
networks:
- app-network
networks:
app-network:
driver: bridge
volumes:
godata:
driver: local
dbdata:
driver: local