forked from djeck1432/spotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.dev.yaml
66 lines (61 loc) · 1.39 KB
/
docker-compose.dev.yaml
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
version: '3.8'
networks:
app_network:
driver: bridge
services:
backend:
build: .
container_name: backend_dev
volumes:
- ./entrypoint.sh:/app/entrypoint.sh
- .:/app # Mount the entire project for easy code updates
env_file:
- .env.dev # Use a different environment file for local development
expose:
- "8000"
ports:
- "8000:8000" # Expose backend to localhost
networks:
- app_network
depends_on:
- db
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_NAME=spotnet
- DB_USER=postgres
- DB_PASSWORD=password
db:
image: postgres:14
container_name: postgres_dev
environment:
POSTGRES_DB: spotnet
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
volumes:
- postgres_data_dev:/var/lib/postgresql/data
- ./init-db:/docker-entrypoint-initdb.d
networks:
- app_network
ports:
- "${DB_PORT:-5432}:5432" # Use environment variable for port mapping
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
timeout: 5s
retries: 5
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.dev
container_name: frontend_dev
volumes:
- ./frontend:/app
ports:
- "3000:80"
networks:
- app_network
depends_on:
- backend
volumes:
postgres_data_dev: