-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.production.yml
60 lines (54 loc) · 1.55 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
version: "3.8"
services:
database:
image: mysql
container_name: mysql-container
command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci --init-connect='SET NAMES UTF8;' --innodb-flush-log-at-trx-commit=0
volumes:
- db-data:/var/lib/mysql
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: "exemple"
MYSQL_USER: lcdt
MYSQL_PASSWORD: lcdt
MYSQL_ROOT_PASSWORD: lcdt
MYSQL_HOST: '%'
php:
build:
context: .
container_name: php-container
volumes:
- ./:/var/www/exemple
ports:
- "9000:9000"
environment:
DATABASE_URL: mysql://lcdt:lcdt@database/exemple?serverVersion=${MYSQL_VERSION:-13}
APP_ENV: prod
nginx:
image: nginx:stable-alpine
container_name: nginx-container
ports:
- "80:80"
- "443:443"
restart: always
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
volumes:
- ./:/var/www/exemple
- .docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
- .docker/certbot/www:/var/www/certbot
- .docker/certbot/conf/:/etc/letsencrypt
depends_on:
- php
- database
environment:
APP_ENV: prod
certbot:
image: certbot/certbot:latest
container_name: cerbot-container
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
volumes:
- .docker/certbot/www/:/var/www/certbot
- .docker/certbot/conf/:/etc/letsencrypt
volumes:
db-data: