-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.prod.yml
78 lines (75 loc) · 2.26 KB
/
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
services:
api:
build:
context: .
dockerfile: docker/prod/api/Dockerfile
depends_on:
mongodb:
condition: service_healthy
mariadb:
condition: service_healthy
restart: unless-stopped
environment:
ENV: "production"
NODE_ENV: "production"
MARIADB_DATABASE: "${MARIADB_DATABASE:?err}"
MARIADB_USERNAME: "${MARIADB_ROOT_USERNAME:?err}"
MARIADB_PASSWORD: "${MARIADB_ROOT_PASSWORD:?err}"
MARIADB_HOST: "mariadb"
MARIADB_PORT: 3306
MONGODB_USERNAME: "${MONGO_INITDB_ROOT_USERNAME:?err}"
MONGODB_PASSWORD: "${MONGO_INITDB_ROOT_PASSWORD:?err}"
MONGODB_HOST: "mongodb"
SECRET: "${SECRET:?err}"
DOMAIN_API: "${DOMAIN_API:?err}"
CORS_ALLOW_ORIGIN: "${CORS_ALLOW_ORIGIN:?err}"
STRIPE_SECRET_KEY: "${STRIPE_SECRET_KEY:?err}"
container_name: vue-game-api
healthcheck:
test: wget --no-verbose --tries=1 --spider http://127.0.0.1:3000/healthz || exit 1
interval: 10s
timeout: 20s
retries: 5
start_period: 60s
front:
build:
context: .
dockerfile: docker/prod/front/Dockerfile
args:
VITE_STRIPE_PUBLIC_KEY: "${VITE_STRIPE_PUBLIC_KEY:?err}"
VITE_API_HOST: "${VITE_API_HOST:?err}"
VITE_WS_HOST: "${VITE_WS_HOST:?err}"
depends_on:
api:
condition: service_healthy
restart: unless-stopped
container_name: vue-game-front
mongodb:
image: mongo
restart: unless-stopped
environment:
MONGO_INITDB_ROOT_USERNAME: "${MONGO_INITDB_ROOT_USERNAME:?err}"
MONGO_INITDB_ROOT_PASSWORD: "${MONGO_INITDB_ROOT_PASSWORD:?err}"
volumes:
- ./data/db:/data/db
container_name: vue-game-mongodb
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/ping --quiet
interval: 10s
timeout: 20s
retries: 5
start_period: 60s
mariadb:
image: mariadb:10.10.2
restart: unless-stopped
container_name: vue-game-mariadb
volumes:
- ./data/mysql:/var/lib/mysql
environment:
MARIADB_ROOT_PASSWORD: "${MARIADB_ROOT_PASSWORD:?err}"
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
interval: 10s
timeout: 20s
retries: 5
start_period: 60s