Files
Shayne Wong e566f514c7 feat: add support for GPT Image 2.5 models with extended quality options and new UI components
- Introduced new image model picker component for selecting models and qualities.
- Updated image model utilities to handle new models and quality options.
- Implemented backend logic for validating image model options and handling requests.
- Added tests for image model selection, quality handling, and API interactions.
- Adjusted existing tests to accommodate new model features and ensure compatibility.
2026-09-10 19:23:50 +08:00

54 lines
1.7 KiB
Docker
Executable File

ARG PYTHON_BASE_IMAGE=python:3.11-slim
ARG NODE_BASE_IMAGE=node:24-alpine
FROM ${NODE_BASE_IMAGE} AS frontend-builder
WORKDIR /frontend
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ ./
RUN npx svelte-kit sync && npm run build
FROM ${PYTHON_BASE_IMAGE} AS python-builder
WORKDIR /app
COPY requirements.txt ./requirements.txt
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
FROM nginx:alpine AS nginx
COPY --from=frontend-builder /frontend/build /usr/share/nginx/html
COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf
FROM ${PYTHON_BASE_IMAGE} AS runtime
LABEL org.opencontainers.image.source="https://github.com/Z1rconium/gpt-image-linux"
RUN groupadd -g 1001 appgroup && \
useradd -u 1001 -g appgroup -s /bin/bash -m appuser
WORKDIR /app
RUN mkdir images data && \
chown -R appuser:appgroup images data
COPY --from=python-builder --chown=appuser:appgroup /install /usr/local
COPY --chown=appuser:appgroup VERSION .
COPY --chown=appuser:appgroup backend/ ./backend/
COPY --from=frontend-builder --chown=appuser:appgroup /frontend/build ./frontend/build
EXPOSE 9090
ENV GRANIAN_INTERFACE=asgi \
GRANIAN_HOST=0.0.0.0 \
GRANIAN_PORT=9090 \
GRANIAN_LOOP=uvloop \
GRANIAN_RUNTIME_THREADS=2 \
GRANIAN_RUNTIME_MODE=auto \
GRANIAN_WORKERS=1 \
GRANIAN_BACKPRESSURE=100 \
GRANIAN_BACKLOG=2048 \
GRANIAN_STATIC_PATH_ROUTE=/_app/immutable \
GRANIAN_STATIC_PATH_MOUNT=/app/frontend/build/_app/immutable \
GRANIAN_STATIC_PATH_EXPIRES=31536000
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:9090/health')" || exit 1
CMD ["granian", "backend.app.main:app"]