-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
87 lines (82 loc) · 2.04 KB
/
docker-compose.yml
File metadata and controls
87 lines (82 loc) · 2.04 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
services:
postgres:
image: postgres:15-alpine
container_name: fieldopt-postgres
environment:
POSTGRES_USER: fieldopt
POSTGRES_PASSWORD: fieldopt
POSTGRES_DB: fieldopt
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U fieldopt"]
interval: 5s
timeout: 5s
retries: 5
networks:
- fieldopt-network
backend:
build:
context: .
dockerfile: Dockerfile
container_name: fieldopt-backend
environment:
DATABASE_URL: postgresql+asyncpg://fieldopt:fieldopt@postgres:5432/fieldopt
API_HOST: 0.0.0.0
API_PORT: 8000
API_RELOAD: "false"
CORS_ORIGINS: '["http://localhost","http://127.0.0.1"]'
LOG_LEVEL: INFO
DEBUG: "false"
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
networks:
- fieldopt-network
healthcheck:
test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:8000/health').raise_for_status()"]
interval: 30s
timeout: 10s
start_period: 40s
retries: 3
nginx:
image: nginx:alpine
container_name: fieldopt-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./deploy/nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./frontend/dist:/usr/share/nginx/html:ro
- /etc/letsencrypt:/etc/letsencrypt:ro
depends_on:
- backend
networks:
- fieldopt-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/"]
interval: 30s
timeout: 10s
start_period: 5s
retries: 3
pgadmin:
image: dpage/pgadmin4:latest
container_name: fieldopt-pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: admin@fieldopt.local
PGADMIN_DEFAULT_PASSWORD: admin
ports:
- "5050:80"
depends_on:
- postgres
networks:
- fieldopt-network
volumes:
postgres_data:
networks:
fieldopt-network:
driver: bridge