Fix: remove image:, single container with StaticFiles
This commit is contained in:
File diff suppressed because it is too large
Load Diff
+10
-1
@@ -22,6 +22,15 @@ app.add_middleware(
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
|
||||
# --- Static Files (Frontend) ---
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
import os
|
||||
|
||||
FRONTEND_DIR = os.path.join(os.path.dirname(__file__), "frontend")
|
||||
if os.path.isdir(FRONTEND_DIR):
|
||||
app.mount("/", StaticFiles(directory=FRONTEND_DIR, html=True), name="frontend")
|
||||
|
||||
# --- Security ---
|
||||
SECRET_KEY = os.environ.get("JWT_SECRET", "wochenplaner-jwt-secret-2024")
|
||||
ALGORITHM = "HS256"
|
||||
@@ -337,5 +346,5 @@ def health():
|
||||
# === STARTUP ===
|
||||
if __name__ == "__main__":
|
||||
import uvicorn
|
||||
port = int(os.environ.get("PORT", 8000))
|
||||
port = int(os.environ.get("PORT", 80))
|
||||
uvicorn.run(app, host="0.0.0.0", port=port)
|
||||
|
||||
+2
-10
@@ -1,23 +1,15 @@
|
||||
services:
|
||||
backend:
|
||||
app:
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile.backend
|
||||
image: wochenplaner-backend:latest
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- PORT=8000
|
||||
- PORT=80
|
||||
- JWT_SECRET=${SERVICE_BASE64_64_JWT:-wochenplaner-jwt-secret}
|
||||
volumes:
|
||||
- wochenplaner_data:/app/data
|
||||
|
||||
frontend:
|
||||
image: nginx:alpine
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./frontend:/var/www/html:ro
|
||||
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
|
||||
volumes:
|
||||
wochenplaner_data:
|
||||
driver: local
|
||||
|
||||
Reference in New Issue
Block a user