-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
100 lines (94 loc) · 2.65 KB
/
docker-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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
services:
web:
container_name: ${APP_CONTAINER_NAME:-yuno-app-container}
build:
context: ./src
dockerfile: ./deploy/production/Dockerfile
command: /start
restart: unless-stopped
expose:
- 8070
env_file:
- .env
depends_on:
- db
networks:
- yuno_network
db:
container_name: ${DB_CONTAINER_NAME:-yuno-db-container}
image: postgres:14-alpine
volumes:
- postgres_data:/var/lib/postgresql/data
- ./scripts/sql:/docker-entrypoint-initdb.d
expose:
- 5432
environment:
- POSTGRES_USER=${DB_USER:?DB_USER variable is not set}
- POSTGRES_PASSWORD=${DB_PASSWORD:?DB_PASSWORD variable is not set}
- POSTGRES_DB=${DB_NAME:-db-prod}
healthcheck:
test: ["CMD", "pg_isready", "-U", "${DB_USER}", "-d", "${DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- yuno_network
redis-server:
container_name: ${REDIS_CONTAINER_NAME:-yuno-redis-container}
image: "redis:alpine"
command:
- /bin/sh
- -c
# - Double dollars, so that the variable is not expanded by Docker Compose
# - Surround by quotes, so that the shell does not split the password
# - The ${variable:?message} syntax causes shell to exit with a non-zero
# code and print a message, when the variable is not set or empty
- redis-server --requirepass "$${REDIS_PASSWORD:?REDIS_PASSWORD variable is not set}"
restart: unless-stopped
expose:
- 6379
env_file:
- .env
environment:
- ALLOW_EMPTY_PASSWORD=no
networks:
- yuno_network
minio:
container_name: ${MINIO_CONTAINER_NAME:-yuno-minio-container}
image: minio/minio:latest
command: "server /data --console-address ':9001'"
volumes:
- ./minio/data:/data
ports:
- "9000:9000"
- "9001:9001"
env_file:
- .env
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:?MINIO_ROOT_USER variable is not set}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:?MINIO_ROOT_PASSWORD variable is not set}
MINIO_BROWSER_REDIRECT_URL: http://minio
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
networks:
- yuno_network
celery-worker:
container_name: ${CELERY_WORKER_CONTAINER_NAME:-yuno-celery-worker-container}
build:
context: ./src
dockerfile: ./deploy/production/Dockerfile
command: /start-celeryworker
env_file:
- .env
depends_on:
- redis-server
- db
networks:
- yuno_network
volumes:
postgres_data:
networks:
yuno_network: