-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
79 lines (74 loc) · 1.61 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
79 lines (74 loc) · 1.61 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
services:
# Redis Cache - Development
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- notes-network
# Django Backend - Development
backend:
build:
context: ./server
dockerfile: Dockerfile
ports:
- "8000:8000"
volumes:
- ./server:/app
- /app/__pycache__
environment:
- DEBUG=1
- DJANGO_SETTINGS_MODULE=config.settings_docker
- POSTGRES_DB=notes_db
- POSTGRES_USER=notes_user
- POSTGRES_PASSWORD=notes_password
- DB_HOST=db
- DB_PORT=5432
command: >
sh -c "python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
depends_on:
- db
- redis
networks:
- notes-network
# Next.js Frontend - Development
frontend:
build:
context: ./client
dockerfile: Dockerfile.dev
ports:
- "3000:3000"
volumes:
- ./client:/app
- /app/node_modules
- /app/.next
environment:
- NODE_ENV=development
- NEXT_PUBLIC_API_URL=http://localhost:8000/api/v1
command: npm run dev
depends_on:
- backend
networks:
- notes-network
# PostgreSQL Database
db:
image: postgres:15-alpine
environment:
POSTGRES_DB: notes_db
POSTGRES_USER: notes_user
POSTGRES_PASSWORD: notes_password
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5433:5432" # Use different port to avoid conflict
networks:
- notes-network
volumes:
postgres_data:
redis_data:
networks:
notes-network:
driver: bridge