-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.dev.yml
61 lines (56 loc) · 1.54 KB
/
docker-compose.dev.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
services:
frontend:
build:
context: ./client # Build the frontend from local code
volumes:
- ./client/src:/app/src # Mount local frontend source code
- ./client/public:/app/public # Mount public files
ports:
- "3000:3000" # Run on port 3000 for local development
environment:
- CHOKIDAR_USEPOLLING=true # Optional: for hot-reload in Docker
networks:
- mynetwork
backend:
build:
context: ./server # Build the backend from local code
ports:
- "5000:5000" # Expose backend on port 5000
depends_on:
- db
volumes:
- ./server:/app # Mount backend code for live reloading
- ./server/uploads:/app/uploads # Handle uploaded files
env_file:
- server/.env # Load environment variables
networks:
- mynetwork
db:
image: postgres:13 # Use the official Postgres image
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: p@ssword
POSTGRES_DB: blogdb
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- mynetwork
nginx:
image: nginx:latest # Nginx service
ports:
- "80:80" # Expose Nginx on port 80 (for frontend + API proxying)
volumes:
- ./nginx.dev.conf:/etc/nginx/nginx.conf # Custom Nginx configuration
- ./client/build:/usr/share/nginx/html # Serve frontend static files from here
depends_on:
- frontend
- backend
networks:
- mynetwork
volumes:
pgdata:
networks:
mynetwork:
driver: bridge