-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
62 lines (56 loc) · 1.3 KB
/
docker-compose.yml
File metadata and controls
62 lines (56 loc) · 1.3 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
version: '3.8'
services:
postgres:
image: postgres:13
environment:
POSTGRES_DB: db
POSTGRES_USER: user
POSTGRES_HOST_AUTH_METHOD: trust # no password
volumes:
- postgres_data:/var/lib/postgresql/data
backend:
build:
context: ./backend
dockerfile: Dockerfile
ports:
# for nginx, only expose to Docker network, not host
#- "8000"
- "8000:8000"
environment:
- DATABASE_URL=postgresql://user@postgres/db
healthcheck:
test: ["CMD", "curl", "-f", "http://0.0.0.0:8000/health"]
interval: 10s
timeout: 10s
retries: 3
depends_on:
- postgres
# optionally map database to localhost
#volumes:
# - ./data/backend:/app # Ensure this maps to a correct path on your host
frontend:
build:
context: ./react-frontend
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
- NODE_ENV=production
depends_on:
backend:
condition: service_healthy
volumes:
- frontend-build:/app/build
nginx:
image: nginx:latest
ports:
- "80:80"
depends_on:
- backend
- frontend
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- frontend-build:/usr/share/nginx/html
volumes:
postgres_data:
frontend-build: