-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
117 lines (103 loc) · 2.82 KB
/
docker-compose.yml
File metadata and controls
117 lines (103 loc) · 2.82 KB
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
volumes:
postgres_data:
services:
### redis
redis:
container_name: idrive-redis
image: redis:latest
restart: unless-stopped
command: ["redis-server", "--requirepass", "${REDIS_PASSWORD}"]
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "PING"]
interval: 5s
timeout: 3s
retries: 5
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD}
deploy:
resources:
limits:
memory: 1G
### database
postgres:
image: postgres:16
container_name: idrive-postgres
restart: unless-stopped
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d idrive-postgres || exit 1" ]
interval: 5s
timeout: 3s
retries: 5
environment:
POSTGRES_DB: idrive-postgres
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
#todo https://hub.docker.com/r/willfarrell/autoheal/
### Main backend
backend:
container_name: idrive-backend
image: ghcr.io/pam-param-pam/idrive-backend:${BACKENDTAG:-latest}
pull_policy: missing
build:
context: ./backend
restart: unless-stopped
ports:
- ${BACKEND_PORT}:8000
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request as u; u.urlopen('http://localhost:8000/healthcheck')\" || exit 1"]
interval: 10s
timeout: 10s
retries: 3
environment:
# General
- IS_DEV_ENV=${IS_DEV_ENV}
- DEPLOYMENT_HOST=${DEPLOYMENT_HOST}
# Backend Configuration
- BACKEND_SECRET_KEY=${BACKEND_SECRET_KEY}
- BACKEND_BASE_URL=${PROTOCOL}://${DEPLOYMENT_HOST}/api
# Redis Configuration
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_ADDRESS=redis
- REDIS_PORT=6379
# Postgres Configuration
- POSTGRES_ADDRESS=postgres
- POSTGRES_PORT=5432
- POSTGRES_NAME=idrive-postgres
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
deploy:
resources:
limits:
memory: 2G
### nginx
nginx:
image: ghcr.io/pam-param-pam/idrive-nginx:${NGINXTAG:-latest}
container_name: idrive-nginx
build:
context: ./frontend
restart: unless-stopped
ports:
- ${NGINX_PORT}:80
depends_on:
backend:
condition: service_healthy
healthcheck:
test: [ "CMD-SHELL", "curl http://localhost:80/healthcheck || exit 1" ]
interval: 10s
timeout: 5s
retries: 5
environment:
- VITE_BACKEND_BASE_URL=${PROTOCOL}://${DEPLOYMENT_HOST}/api
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
deploy:
resources:
limits:
memory: 1G