-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
70 lines (65 loc) · 1.55 KB
/
docker-compose.yml
File metadata and controls
70 lines (65 loc) · 1.55 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
version: '3.8'
services:
# PostgreSQL Database
db:
image: postgres:15-alpine
container_name: votequest_db
environment:
POSTGRES_USER: votequest_user
POSTGRES_PASSWORD: password123
POSTGRES_DB: votequest_db
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U votequest_user -d votequest_db"]
interval: 10s
timeout: 5s
retries: 5
networks:
- votequest_network
# FastAPI Backend
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: votequest_backend
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
environment:
DATABASE_URL: postgresql://votequest_user:password123@db:5432/votequest_db
CORS_ORIGINS: '["http://localhost:3000", "http://localhost:8000"]'
DEBUG: "true"
ENVIRONMENT: "development"
ports:
- "8000:8000"
volumes:
- ./backend:/app
depends_on:
db:
condition: service_healthy
networks:
- votequest_network
# Next.js Frontend
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: votequest_frontend
command: npm run dev
environment:
NEXT_PUBLIC_API_URL: http://localhost:8000
ports:
- "3000:3000"
volumes:
- ./frontend:/app
- /app/node_modules
depends_on:
- backend
networks:
- votequest_network
volumes:
postgres_data:
networks:
votequest_network:
driver: bridge