-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
71 lines (65 loc) · 1.87 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
version: '3'
services:
nginx:
image: nginx:1.23-alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./public:/var/www/public
- ./nginx.localhost:/etc/nginx/conf.d #uncomment this line if certbot generate for the first time and run ./init-letsencrypt.sh
#- ./nginx:/etc/nginx/conf.d #uncomment this line after certbot generated cert & comment line above. Then run docker-compose up/docker-compose up -d
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
environment:
- TZ=Asia/Jakarta
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:
- ./certbot/conf/:/etc/letsencrypt
- ./certbot/logs/:/var/log/letsencrypt
- ./certbot/www:/var/www/certbot
depends_on:
- nginx
environment:
- TZ=Asia/Jakarta
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
php:
build:
context: .
dockerfile: php/Dockerfile
volumes:
- .:/var/www
restart: unless-stopped
environment:
- TZ=Asia/Jakarta
mysql:
image: mysql:8
restart: unless-stopped
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=0123456789
- MYSQL_USER=dbuser
- MYSQL_PASSWORD=9876543210
- MYSQL_DATABASE=dbname
- TZ=Asia/Jakarta
volumes:
- "mysql_data:/var/lib/mysql"
pgsql:
image: postgres:15-alpine
restart: always
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=example
- TZ=Asia/Jakarta
volumes:
- "pgsql_data:/var/lib/postgresql/data"
volumes:
mysql_data: { driver: local }
pgsql_data: { driver: local }