duqing2026's picture
Fix Jinja2 error, add auto-save & JSON export, optimize Dockerfile
a30d178
raw
history blame contribute delete
445 Bytes
FROM python:3.9-slim
WORKDIR /app
# Install dependencies first to leverage cache
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . /app
# Create a non-root user and switch to it
RUN useradd -m -u 1000 user
# Set ownership
RUN chown -R user:user /app
USER user
ENV PATH="/home/user/.local/bin:$PATH"
EXPOSE 7860
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]