Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
65 lines (61 loc) · 1.56 KB
/
Copy pathdocker-compose.yml
File metadata and controls
65 lines (61 loc) · 1.56 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
version: '3.8'
services:
db:
image: postgres:17
environment:
POSTGRES_DB: factory_maintenance_db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
volumes:
- postgres_data:/var/lib/postgresql/data
- ./backend/database_backup.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
backend:
build:
context: .
dockerfile: Dockerfile
target: backend
command: sh -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
volumes:
- ./backend:/app/backend
- media_files:/app/backend/media
ports:
- "8000:8000"
environment:
- DB_NAME=factory_maintenance_db
- DB_USER=postgres
- DB_PASSWORD=password
- DB_HOST=db
- DB_PORT=5432
- DEBUG=True
- SECRET_KEY=django-insecure-dev-key-change-in-production-12345
- ALLOWED_HOSTS=localhost,127.0.0.1,backend
- CORS_ALLOWED_ORIGINS=http://localhost:3000
depends_on:
db:
condition: service_healthy
frontend:
build:
context: .
dockerfile: Dockerfile
target: frontend
volumes:
- ./frontend:/app/frontend
- /app/frontend/node_modules
- /app/frontend/.next
ports:
- "3000:3000"
environment:
- NEXT_PUBLIC_API_URL=http://localhost:8000/api
- NEXT_PUBLIC_GEMINI_API_KEY=${GEMINI_API_KEY}
depends_on:
- backend
volumes:
postgres_data:
media_files: