-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
48 lines (45 loc) · 1.54 KB
/
Copy pathdocker-compose.yml
File metadata and controls
48 lines (45 loc) · 1.54 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
# Production-shaped local stack: both services build from source and run real
# servers (gunicorn / nginx) as non-root users -- no development servers.
#
# Before the first run:
# cp backend/.env.example backend/.env
# # then set OPENAI_API_KEY, and DJANGO_SECRET_KEY if you set DEBUG=False
#
# The .env file is gitignored, so it is absent on a fresh clone. It is declared
# with `required: false` so compose itself does not error out. Without it the
# backend still exits deliberately, logging that DJANGO_SECRET_KEY is required
# -- that fail-loud behaviour is the point. Provide the .env and it starts.
services:
backend:
build:
context: ./backend
env_file:
- path: ./backend/.env
required: false
environment:
# SQLite inside the container: no database service needed.
DB_ENGINE: django.db.backends.sqlite3
DB_NAME: /app/data/db.sqlite3
DEBUG: ${DEBUG:-False}
ALLOWED_HOSTS: ${ALLOWED_HOSTS:-localhost,127.0.0.1}
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS:-http://localhost:5173}
# Local HTTP only; set to True behind real TLS.
SECURE_SSL_REDIRECT: ${SECURE_SSL_REDIRECT:-False}
ports:
- "8000:8000"
volumes:
- backend-data:/app/data
restart: unless-stopped
frontend:
build:
context: ./frontend
args:
# Resolved by the user's browser, so it is the published host port.
VITE_API_URL: http://localhost:8000/api
ports:
- "5173:8080"
depends_on:
- backend
restart: unless-stopped
volumes:
backend-data: