# Upgrade the backend while retaining the deployment's verified frontend themes. # BASE_IMAGE must be a locally pinned backup of the existing deployment image. ARG BASE_IMAGE FROM ${BASE_IMAGE} ARG APP_VERSION ARG VCS_REF LABEL org.opencontainers.image.version="${APP_VERSION}" LABEL org.opencontainers.image.revision="${VCS_REF}" WORKDIR /app COPY VERSION requirements.txt main.py ./ COPY apps ./apps COPY core ./core COPY scripts ./scripts RUN pip install --no-cache-dir -r requirements.txt ENV APP_VERSION="${APP_VERSION}" ENV TIMEOUT_KEEP_ALIVE=5 MALLOC_TRIM_THRESHOLD_=65536 CMD ["sh", "-c", "access_log_arg=--no-access-log; if [ \"${APP_ENV:-development}\" != \"production\" ] || [ \"${ACCESS_LOG:-false}\" = \"true\" ]; then access_log_arg=--access-log; fi; exec uvicorn main:app --host \"$HOST\" --port \"$PORT\" --workers \"$WORKERS\" --log-level \"$LOG_LEVEL\" \"$access_log_arg\" --timeout-keep-alive \"${TIMEOUT_KEEP_ALIVE:-5}\" --proxy-headers --forwarded-allow-ips \"${FORWARDED_ALLOW_IPS:-}\""]