Finalize Docker setup for Aniworld app
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user