fix docker

This commit is contained in:
Gal 2025-07-16 00:17:27 +02:00
parent 33eaea8d39
commit b231733dfb
Signed by: gal
GPG Key ID: F035BC65003BC00B
1 changed files with 11 additions and 9 deletions

View File

@ -18,19 +18,21 @@ RUN apt-get update && apt-get install -y \
# Install UV for faster Python package management
RUN pip install uv
# Copy pyproject.toml and uv.lock
COPY pyproject.toml uv.lock ./
# Create non-root user early
RUN useradd --create-home --shell /bin/bash app && \
chown -R app:app /app
# Install Python dependencies
# Switch to app user
USER app
# Copy pyproject.toml and uv.lock
COPY --chown=app:app pyproject.toml uv.lock ./
# Install Python dependencies as app user
RUN uv sync --frozen --no-dev
# Copy application code
COPY . .
# Create non-root user
RUN useradd --create-home --shell /bin/bash app && \
chown -R app:app /app
USER app
COPY --chown=app:app . .
# Expose port
EXPOSE 8000