diff --git a/Dockerfile b/Dockerfile index 5ea8bb7d..3508d84b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,6 @@ -# Stage 1: Build frontend assets -FROM node:22-slim AS builder -RUN corepack enable -WORKDIR /app -COPY package.json pnpm-lock.yaml ./ -RUN pnpm install --frozen-lockfile -COPY . . -RUN pnpm build - -# Stage 2: Production image FROM python:3.12-slim WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt -COPY --from=builder /app/webapp ./webapp -COPY data ./data +COPY . . CMD ["gunicorn", "--chdir", "webapp", "-b", "0.0.0.0:8000", "app:app"] diff --git a/webapp/app.py b/webapp/app.py index 115c8ae4..14613ae5 100644 --- a/webapp/app.py +++ b/webapp/app.py @@ -6,6 +6,9 @@ url_for, request, ) + +from werkzeug.middleware.proxy_fix import ProxyFix + import json import datetime @@ -17,6 +20,8 @@ app = Flask(__name__) +app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1, x_host=1) + ############################################################################### # DATA ###############################################################################