-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.scalable.yml
More file actions
70 lines (65 loc) · 1.44 KB
/
docker-compose.scalable.yml
File metadata and controls
70 lines (65 loc) · 1.44 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
# docker-compose -f docker-compose.scalable.yml up
services:
api:
build: .
command: sh -c "./migrate -with-seeds && ./api"
env_file: .env
environment:
DB_DRIVER: postgres
DB_HOST: postgres
DB_PORT: 5432
DB_USER: ${DB_USER:-apime}
DB_PASSWORD: ${DB_PASSWORD:-apime}
DB_NAME: ${DB_NAME:-apime}
REDIS_ENABLED: "true"
ports:
- "8080:8080"
volumes:
- apime_media:/app/data/media
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- apime_net
restart: unless-stopped
postgres:
image: postgres:15
container_name: apime-postgres
environment:
POSTGRES_DB: ${DB_NAME:-apime}
POSTGRES_USER: ${DB_USER:-apime}
POSTGRES_PASSWORD: ${DB_PASSWORD:-apime}
volumes:
- postgres:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- apime_net
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-apime} -d ${DB_NAME:-apime}"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7
container_name: apime-redis
volumes:
- redis:/data
ports:
- "6379:6379"
networks:
- apime_net
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
volumes:
apime_media:
postgres:
redis:
networks:
apime_net:
driver: bridge