Skip to content

alternative dockerfile based on chainguard base #59

@adamscarberry

Description

@adamscarberry
FROM ghcr.io/usace/usace-wm-python:3.13

# Set working directory
WORKDIR /code

# Install dependencies as root into system Python
COPY requirements.txt .
COPY requirements-dev.txt .

USER root

RUN python -m pip install --no-cache-dir -r requirements.txt \
    && python -m pip install --no-cache-dir -r requirements-dev.txt

# Copy app code
COPY ./cwms_batch_events/api ./cwms_batch_events/api

# Expose port
EXPOSE 8000

# Switch to non-root user
USER appuser

# Run using python -m uvicorn (ensures system packages are used)
CMD ["python", "-m", "uvicorn", \
     "cwms_batch_events.api.main:app", \
     "--workers", "2", \
     "--worker-class", "uvicorn.workers.UvicornWorker", \
     "--bind", "0.0.0.0:8000", \
     "--access-logfile", "-", \
     "--error-logfile", "-"]

requires adding requests to your requirements.txt

@jbkolze FYI

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions