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=["*"],
|
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 ---
|
# --- Security ---
|
||||||
SECRET_KEY = os.environ.get("JWT_SECRET", "wochenplaner-jwt-secret-2024")
|
SECRET_KEY = os.environ.get("JWT_SECRET", "wochenplaner-jwt-secret-2024")
|
||||||
ALGORITHM = "HS256"
|
ALGORITHM = "HS256"
|
||||||
@@ -337,5 +346,5 @@ def health():
|
|||||||
# === STARTUP ===
|
# === STARTUP ===
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import uvicorn
|
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)
|
uvicorn.run(app, host="0.0.0.0", port=port)
|
||||||
|
|||||||
+2
-10
@@ -1,23 +1,15 @@
|
|||||||
services:
|
services:
|
||||||
backend:
|
app:
|
||||||
build:
|
build:
|
||||||
context: ./backend
|
context: ./backend
|
||||||
dockerfile: Dockerfile.backend
|
dockerfile: Dockerfile.backend
|
||||||
image: wochenplaner-backend:latest
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- PORT=8000
|
- PORT=80
|
||||||
- JWT_SECRET=${SERVICE_BASE64_64_JWT:-wochenplaner-jwt-secret}
|
- JWT_SECRET=${SERVICE_BASE64_64_JWT:-wochenplaner-jwt-secret}
|
||||||
volumes:
|
volumes:
|
||||||
- wochenplaner_data:/app/data
|
- 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:
|
volumes:
|
||||||
wochenplaner_data:
|
wochenplaner_data:
|
||||||
driver: local
|
driver: local
|
||||||
|
|||||||
Reference in New Issue
Block a user