Introduce S3-compatible storage support and update local/dev configuration. - .claude: add "WebSearch" to local settings - backend/.env.example: add USE_S3 flag and detailed S3/MinIO (RustFS) example env vars + comments to explain dev vs production usage - backend/vontor_cz/settings.py: refactor to use USE_S3 boolean; set STATIC_ROOT; configure STORAGES for local filesystem vs S3 backends; add handling for S3 endpoint (MinIO/RustFS) vs real AWS S3 including path-style addressing, URL construction, and sensible AWS defaults - docker-compose.yml: add rustfs to service dependencies, include rustfs in networks, change frontend port mapping to 8001:80, and add rustfs-data volume binding These changes enable using a local S3-compatible backend (RustFS/MinIO) in development while keeping the option to swap to real AWS S3 for production.
169 lines
3.7 KiB
YAML
169 lines
3.7 KiB
YAML
services:
|
|
backend:
|
|
container_name: backend-vontor-cz
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
restart: always
|
|
env_file:
|
|
- ./backend/.env
|
|
networks:
|
|
- app_network
|
|
depends_on:
|
|
- db
|
|
- redis
|
|
- rustfs
|
|
volumes:
|
|
- ./backend:/app
|
|
- static-data:/app/collectedstaticfiles
|
|
- media-data:/app/media
|
|
command: sh -c "
|
|
python manage.py migrate --noinput &&
|
|
python manage.py collectstatic --clear --noinput &&
|
|
python manage.py seed_app_config &&
|
|
gunicorn -k uvicorn.workers.UvicornWorker vontor_cz.asgi:application --bind 0.0.0.0:8000 --timeout 600 --graceful-timeout 30 --workers 2"
|
|
ports:
|
|
- "8000:8000"
|
|
|
|
db:
|
|
image: postgres:15-alpine
|
|
container_name: postgres-vontor-cz
|
|
restart: always
|
|
env_file:
|
|
- ./backend/.env
|
|
volumes:
|
|
- db-data:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
networks:
|
|
- app_network
|
|
|
|
|
|
redis: #extremly fast db, stores data in RAM memory
|
|
container_name: redis-vontor-cz
|
|
image: redis:alpine
|
|
restart: always
|
|
env_file:
|
|
- ./backend/.env
|
|
volumes:
|
|
- redis-data:/data
|
|
expose:
|
|
- "6379"
|
|
networks:
|
|
- app_network
|
|
|
|
celery: #task queue for handling asynchronous/hard tasks
|
|
container_name: celery-vontor-cz
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
command: celery -A vontor_cz worker --loglevel=info
|
|
restart: always
|
|
env_file:
|
|
- ./backend/.env
|
|
volumes:
|
|
- ./backend:/app
|
|
depends_on:
|
|
- redis
|
|
- db
|
|
- backend
|
|
- rustfs
|
|
networks:
|
|
- app_network
|
|
|
|
celery-beat: #periodic tasks scheduler
|
|
container_name: celery-beat-vontor-cz
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
command: celery -A vontor_cz beat --loglevel=info
|
|
restart: always
|
|
env_file:
|
|
- ./backend/.env
|
|
volumes:
|
|
- ./backend:/app
|
|
depends_on:
|
|
- redis
|
|
- db
|
|
- backend
|
|
- rustfs
|
|
networks:
|
|
- app_network
|
|
|
|
# janus-media-server: #WebRTC media server for handling real-time audio/video streaming
|
|
# container_name: janus-vontor-cz
|
|
# image: meetecho/janus-gateway:latest
|
|
# restart: always
|
|
# env_file:
|
|
# - ./backend/.env
|
|
# ports:
|
|
# - "8088:8088" # HTTP API
|
|
# - "8188:8188" # WebSocket API
|
|
# - "10000-10200:10000-10200/udp" # Media ports (UDP)
|
|
# networks:
|
|
# - app_network
|
|
|
|
#https://github.com/meetecho/janus-gateway
|
|
|
|
#end of backend services -----------------------
|
|
|
|
nginx: #web server, reverse proxy, serves static files
|
|
container_name: nginx-vontor-cz
|
|
profiles:
|
|
- production
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile.prod
|
|
env_file:
|
|
- ./frontend/.env
|
|
ports:
|
|
- 8001:80
|
|
depends_on:
|
|
- backend
|
|
networks:
|
|
- app_network
|
|
volumes:
|
|
- ./frontend/dist:/usr/share/nginx/html
|
|
- static-data:/app/collectedstaticfiles # static (Django)
|
|
- media-data:/app/media # media (Django)
|
|
- ./frontend/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
|
|
|
|
|
|
networks:
|
|
app_network:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
redis-data:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: bind
|
|
device: ./volumes/redis
|
|
db-data:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: bind
|
|
device: ./volumes/postgres
|
|
static-data:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: bind
|
|
device: ./volumes/static
|
|
media-data:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: bind
|
|
device: ./volumes/media
|
|
rustfs-data:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: bind
|
|
device: ./volumes/rustfs
|
|
|