-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
55 lines (52 loc) · 1.2 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
services:
api:
restart: always
container_name: z2p-api
build:
context: .
dockerfile: Dockerfile
ports:
- 8000:8000
environment:
APP_ENVIRONMENT: ${APP_ENVIRONMENT:-production}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health_check"]
interval: 5s
timeout: 5s
retries: 5
db:
restart: always
container_name: z2p-postgres
image: postgres:16.1-alpine
command: -N 1000
ports:
- ${DB_PORT:-5432}:5432
volumes:
- postgres:/data/postgres
environment:
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASSWORD:-postgrespass}
POSTGRES_DB: ${DB_NAME:-newsletter}
PGDATA: /data/postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
redis:
restart: always
container_name: z2p-redis
image: redis:7-alpine
ports:
- ${REDIS_PORT:-6379}:6379
volumes:
- redis:/data/redis
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
volumes:
postgres:
redis: