Archived
Reviewed and merged by Reid (Hermes Reviewer) Co-authored-by: crisleo-hermes <hermes@codescripters.org> Co-committed-by: crisleo-hermes <hermes@codescripters.org>
58 lines
1.2 KiB
YAML
58 lines
1.2 KiB
YAML
services:
|
|
db:
|
|
image: postgres:15
|
|
restart: unless-stopped
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
environment:
|
|
POSTGRES_DB: cloud_reader
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres -d cloud_reader"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "8000:8000"
|
|
environment:
|
|
DJANGO_SECRET_KEY: "dev-secret-key-change-in-production"
|
|
DJANGO_DEBUG: "True"
|
|
DB_NAME: cloud_reader
|
|
DB_USER: postgres
|
|
DB_PASSWORD: postgres
|
|
DB_HOST: db
|
|
DB_PORT: "5432"
|
|
volumes:
|
|
- ./backend:/app
|
|
- book_media:/app/media
|
|
command: >
|
|
sh -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "5173:5173"
|
|
environment:
|
|
VITE_API_URL: "http://localhost:8000"
|
|
volumes:
|
|
- ./frontend:/app
|
|
- /app/node_modules
|
|
depends_on:
|
|
- backend
|
|
|
|
volumes:
|
|
postgres_data:
|
|
book_media: |