-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
66 lines (66 loc) · 1.51 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
version: '3.3'
services:
db:
platform: linux/x86_64
image: mysql:8.0
restart: always
container_name: db
cap_add:
- SYS_NICE
environment:
MYSQL_DATABASE: gotest
MYSQL_USER: gouser
MYSQL_PASSWORD: gouser123
MYSQL_ROOT_PASSWORD: gouser123
ports:
- '3306:3306'
expose:
- '3306'
volumes:
- my-db:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 5s
retries: 10
web:
build: .
container_name: web
restart: always
depends_on:
db:
condition: service_healthy
ports:
- '3000:3000'
expose:
- '3000'
links:
- "db"
environment:
GO_ENV: production
GO_PORT: 3000
DB_USER: gouser
DB_PASSWORD: gouser123
DB_NAME: gotest
DB_HOST: db
GIN_MODE: release
webserver:
image: nginx:latest
restart: always
volumes:
- ./nginx/conf/:/etc/nginx/conf.d/:ro
- ./nginx/certbot/:/etc/letsencrypt/:ro
- ./certbot/www:/var/www/certbot/:ro
- ./certbot/conf/:/etc/nginx/ssl/:ro
ports:
- 80:80
- 443:443
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/dns-cloudflare:latest
restart: unless-stopped
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www/:/var/www/certbot/:rw
- ./cloudflare.ini:/var/www/certbot/cloudflare.ini:rw
volumes:
my-db: