-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
75 lines (70 loc) · 1.71 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
version: "3.8"
services:
app:
build: .
container_name: AdTestPro
volumes:
- .:/app
ports:
- "8000:8000"
networks:
- adtestpro-network
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- DATABASE_URL=postgresql://adtestpro:adtestpro@postgres:5432/adtestpro_oss
env_file:
- .env
depends_on:
- postgres
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
postgres:
image: postgres:16.2
container_name: postgres
restart: always
environment:
- POSTGRES_USER=adtestpro
- POSTGRES_PASSWORD=adtestpro
- POSTGRES_DB=adtestpro_oss
ports:
- "5432:5432"
networks:
- adtestpro-network
volumes:
- postgres_data:/var/lib/postgresql/data
- ./docker-assets/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U adtestpro -d adtestpro_oss"]
interval: 10s
timeout: 5s
retries: 5
pgadmin:
image: dpage/pgadmin4
restart: always
container_name: pgadmin
environment:
- PGADMIN_DEFAULT_PASSWORD=password
- PGADMIN_SERVER_HOST=postgres
- PGADMIN_SERVER_PORT=5432
- PGADMIN_SERVER_USER=adtestpro
- PGADMIN_SERVER_PASSWORD=adtestpro
- PGADMIN_SERVER_DB=adtestpro_oss
ports:
- "5050:80"
networks:
- adtestpro-network
volumes:
- pgadmin_data:/var/lib/pgadmin
depends_on:
postgres:
condition: service_healthy
networks:
adtestpro-network:
name: adtestpro-network
volumes:
postgres_data:
pgadmin_data: