Files
oxpanel25/docker-compose.yml
2025-05-03 01:22:03 +02:00

103 lines
2.7 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

services:
redis:
image: valkey/valkey:alpine
restart: unless-stopped
web:
image: nginx:alpine
volumes:
- ./app/static_collected:/app/static_collected:ro
- ./app/media:/app/media:ro
- ./nginx/default.nginx:/etc/nginx/conf.d/default.conf:ro
- ./transmission/downloads/complete/:/transmission/downloads/complete:ro
labels:
- "traefik.enable=true"
- "traefik.docker.network=web"
# Routeur HTTP (port 80) pour la redirection vers HTTPS
- "traefik.http.routers.web-http.rule=${TRAEFIK_HOST_RULE}"
- "traefik.http.routers.web-http.entrypoints=web"
- "traefik.http.routers.web-http.middlewares=redirect-to-https"
# Middleware de redirection
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
# Routeur HTTPS
- "traefik.http.routers.web.rule=${TRAEFIK_HOST_RULE}"
- "traefik.http.routers.web.entrypoints=websecure"
- "traefik.http.routers.web.tls.certresolver=le"
# Port du container cible (le port d'écoute de Nginx à lintérieur du conteneur)
- "traefik.http.services.web.loadbalancer.server.port=80"
ports:
- "${LISTEN_PORT:-8000}:80"
restart: unless-stopped
networks:
- web
- default
depends_on:
- app
transmission:
image: linuxserver/transmission
environment:
- TZ=Europe/Paris
- PUID=${USER_ID}
- PGID=${GROUP_ID}
ports:
- "51413:51413"
- "51413:51413/udp"
volumes:
- ./transmission/config:/config
- ./transmission/downloads:/downloads
restart: unless-stopped
app:
build:
context: ./app
dockerfile: "Dockerfile"
args:
puid: ${USER_ID}
pgid: ${GROUP_ID}
debug: ${DEBUG:-false}
env_file:
- .env
volumes:
- ./app:/app
- ./transmission:/transmission:ro
- /app/frontend/node_modules
restart: unless-stopped
depends_on:
- redis
- transmission
command: >
bash -c "sleep 10
&& cd frontend && yarn build && cd ..
&& python manage.py collectstatic --noinput
&& python manage.py migrate
&& uvicorn app.asgi:application --workers 3 --host 0.0.0.0 --port 8000 --lifespan off --loop uvloop --ws websockets --log-level info"
# celery:
# extends:
# service: app
# restart: unless-stopped
# depends_on:
# - redis
# - app
# command: >
# bash -c "sleep 5 & celery -A app worker -E -B"
event:
extends:
service: app
restart: unless-stopped
depends_on:
- redis
- app
- transmission
command: >
bash -c "sleep 15 & python manage.py torrent_event"
networks:
web:
external: true