71 lines
1.5 KiB
YAML
71 lines
1.5 KiB
YAML
services:
|
|
web:
|
|
build: ./app
|
|
command: >
|
|
sh -c "
|
|
python manage.py makemigrations --noinput &&
|
|
python manage.py migrate --noinput &&
|
|
python manage.py collectstatic --noinput &&
|
|
gunicorn --bind 0.0.0.0:8000 project.wsgi:application --workers 4
|
|
"
|
|
ports:
|
|
- '8000:8000'
|
|
expose:
|
|
- 8000
|
|
env_file:
|
|
- .env
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
volumes:
|
|
- static_volume:/home/app/web/static/
|
|
|
|
api:
|
|
build: ./api
|
|
command: uvicorn main:app --host 0.0.0.0 --port 8000 --reload
|
|
ports:
|
|
- '8001:8000'
|
|
depends_on:
|
|
- web
|
|
- redis
|
|
env_file:
|
|
- .env
|
|
restart: unless-stopped
|
|
|
|
postgres:
|
|
image: postgres:15
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data/
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- '5432:5432'
|
|
healthcheck:
|
|
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ]
|
|
interval: 10s
|
|
timeout: 60s
|
|
retries: 3
|
|
start_period: 10s
|
|
|
|
mediamtx:
|
|
image: bluenviron/mediamtx:latest
|
|
container_name: mediamtx
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8554:8554" # RTSP
|
|
- "8888:8888" # HLS
|
|
- "8889:8889" # WebRTC
|
|
- "9997:9997" # HTTP API
|
|
volumes:
|
|
- ./mediamtx/mediamtx.yml:/mediamtx.yml:ro
|
|
|
|
ai-service:
|
|
command: ["python", "ml/streaming.py", ]
|
|
build: ./app
|
|
restart: always
|
|
env_file:
|
|
- .env
|
|
|
|
volumes:
|
|
postgres_data:
|
|
static_volume: |