113 lines
2.9 KiB
YAML
113 lines
2.9 KiB
YAML
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 à l’intérieur du conteneur)
|
||
- "traefik.http.services.web.loadbalancer.server.port=80"
|
||
restart: unless-stopped
|
||
networks:
|
||
- web
|
||
- default
|
||
depends_on:
|
||
- app
|
||
|
||
gluetun:
|
||
image: qmcgaw/gluetun
|
||
cap_add:
|
||
- NET_ADMIN
|
||
devices:
|
||
- /dev/net/tun:/dev/net/tun
|
||
environment:
|
||
- VPN_SERVICE_PROVIDER=protonvpn
|
||
- VPN_TYPE=wireguard
|
||
- WIREGUARD_PRIVATE_KEY=${PROTON_PKEY}
|
||
- SERVER_COUNTRIES=${PROTON_COUNTRIES}
|
||
- VPN_PORT_FORWARDING=on
|
||
- VPN_PORT_FORWARDING_PROVIDER=protonvpn
|
||
networks:
|
||
- default
|
||
volumes:
|
||
- gluetun_data:/tmp/gluetun
|
||
restart: unless-stopped
|
||
|
||
transmission:
|
||
image: linuxserver/transmission
|
||
network_mode: "service:gluetun"
|
||
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: ./
|
||
dockerfile: .docker/app/Dockerfile
|
||
env_file:
|
||
- .env
|
||
volumes:
|
||
- ./app:/oxpanel/app
|
||
- ./transmission:/transmission:ro
|
||
- gluetun_data:/tmp/gluetun:ro
|
||
- /oxpanel/app/frontend/node_modules
|
||
restart: unless-stopped
|
||
depends_on:
|
||
- redis
|
||
- gluetun
|
||
healthcheck:
|
||
interval: 10s
|
||
timeout: 5s
|
||
retries: 3
|
||
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
||
command: >
|
||
python manage.py migrate
|
||
&& uvicorn app.asgi:application --config uvicorn_config.py"
|
||
|
||
event:
|
||
extends:
|
||
service: app
|
||
restart: unless-stopped
|
||
depends_on:
|
||
- redis
|
||
- app
|
||
- gluetun
|
||
command: >
|
||
bash -c "sleep 2 && python manage.py torrent_event"
|
||
|
||
networks:
|
||
web:
|
||
external: true
|
||
|
||
volumes:
|
||
gluetun_data:
|