Finalize Docker setup for Aniworld app

This commit is contained in:
2026-02-22 19:57:46 +01:00
parent 6c7dc66c5d
commit d8248be67d
3 changed files with 84 additions and 7 deletions

View File

@@ -1,6 +1,8 @@
services:
vpn:
build: .
build:
context: .
dockerfile: Containerfile
container_name: vpn-wireguard
cap_add:
- NET_ADMIN
@@ -12,7 +14,6 @@ services:
- ./wg0.conf:/etc/wireguard/wg0.conf:ro
- /lib/modules:/lib/modules:ro
ports:
# Expose app's port 8000 to the local network through the VPN container
- "8000:8000"
environment:
- HEALTH_CHECK_INTERVAL=10
@@ -26,12 +27,21 @@ services:
retries: 3
app:
image: python:3.12-alpine
container_name: vpn-app
# Share the VPN container's network — all outgoing traffic goes through WireGuard
build:
context: ..
dockerfile: Docker/Dockerfile.app
container_name: aniworld-app
network_mode: "service:vpn"
depends_on:
vpn:
condition: service_healthy
# Example: simple HTTP server on port 8000. Replace with your actual app.
command: ["python3", "-m", "http.server", "8000"]
environment:
- PYTHONUNBUFFERED=1
volumes:
- app-data:/app/data
- app-logs:/app/logs
restart: unless-stopped
volumes:
app-data:
app-logs: