-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
143 lines (137 loc) · 3.89 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
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
version: '3.9'
services:
backend:
image: ${IMAGE}:${TAG}
restart: always
command: --migrate
expose:
- ${PORT}
networks:
- traefik-net
- backend
environment:
PORT: ${PORT}
RCON_HOST: ${RCON_HOST}
RCON_PORT: ${RCON_PORT}
RCON_PASS: ${RCON_PASS}
SESSION_SECRET: ${SESSION_SECRET}
ORIGIN: ${ORIGIN}
FK_SIGN: ${FK_SIGN}
NODE_ENV: ${ENVIRONMENT}
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
DB_NAME: ${DB_NAME}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
ADMIN_KEY: ${ADMIN_KEY}
S3_URL: ${S3_URL}
S3_BUCKET: ${S3_BUCKET}
S3_REGION: ${S3_REGION}
S3_KEY_ID: ${S3_KEY_ID}
S3_SECRET_KEY: ${S3_SECRET_KEY}
depends_on:
db:
condition: service_healthy
createbuckets:
condition: service_completed_successfully
labels:
traefik.enable: true
traefik.docker.network: traefik-net
traefik.http.routers.api.rule: 'Host(`${DEPLOY_HOST}`) && PathPrefix(`/api`)'
traefik.http.routers.api.entrypoints: https
traefik.http.routers.api.tls: true
traefik.http.routers.api.tls.certresolver: letsencrypt
traefik.http.services.api.loadBalancer.server.port: ${PORT}
traefik.http.middlewares.api-stripprefix.stripprefix.prefixes: /api
traefik.http.middlewares.api-compress.compress: true
traefik.http.routers.api.middlewares: api-stripprefix,api-compress,default-ratelimit
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:${PORT}/
interval: 10s
retries: 3
timeout: 1s
start_period: 5s
logging:
driver: json-file
options:
max-size: 10m
db:
image: postgres:14-alpine
restart: always
expose:
- ${DB_PORT}
volumes:
- postgres-data:/var/lib/postgresql/data:rw
networks:
- backend
environment:
PGPORT: ${DB_PORT}
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
PGDATA: /var/lib/postgresql/data
healthcheck:
test: pg_isready -d ${DB_NAME}
interval: 10s
retries: 3
timeout: 1s
start_period: 5s
logging:
driver: json-file
options:
max-size: 10m
minio:
image: quay.io/minio/minio:RELEASE.2023-02-10T18-48-39Z
restart: always
command: server /data --address :${MINIO_PORT} --console-address :${MINIO_CONSOLE_PORT}
expose:
- ${MINIO_PORT}
- ${MINIO_CONSOLE_PORT}
volumes:
- minio-data:/data:rw
networks:
- traefik-net
- backend
environment:
MINIO_ROOT_USER: ${S3_KEY_ID}
MINIO_ROOT_PASSWORD: ${S3_SECRET_KEY}
MINIO_SITE_REGION: ${S3_REGION}
MINIO_BROWSER_REDIRECT_URL: https://console.minio.${DEPLOY_HOST}
labels:
traefik.enable: true
traefik.docker.network: traefik-net
traefik.http.routers.minio.rule: 'Host(`console.minio.${DEPLOY_HOST}`)'
traefik.http.routers.minio.entrypoints: https
traefik.http.routers.minio.tls: true
traefik.http.routers.minio.tls.certresolver: letsencrypt
traefik.http.services.minio.loadBalancer.server.port: ${MINIO_CONSOLE_PORT}
healthcheck:
test: curl --fail http://localhost:${MINIO_PORT}/minio/health/live
interval: 10s
retries: 3
timeout: 1s
start_period: 15s
logging:
driver: json-file
options:
max-size: 10m
createbuckets:
image: quay.io/minio/mc:RELEASE.2023-01-28T20-29-38Z
networks:
- backend
depends_on:
minio:
condition: service_healthy
entrypoint: |
bash -ec "
/usr/bin/mc alias set minio ${S3_URL} ${S3_KEY_ID} ${S3_SECRET_KEY};
/usr/bin/mc mb --ignore-existing --region ${S3_REGION} minio/${S3_BUCKET};
"
networks:
traefik-net:
external: true
name: traefik-net
backend:
volumes:
postgres-data:
minio-data: