Skip to content

Instantly share code, notes, and snippets.

@jnbdz
Created March 19, 2026 19:24
Show Gist options
  • Select an option

  • Save jnbdz/3fed3c8f3bf5d46a1bb24cd4f59fc4fe to your computer and use it in GitHub Desktop.

Select an option

Save jnbdz/3fed3c8f3bf5d46a1bb24cd4f59fc4fe to your computer and use it in GitHub Desktop.
FROM python:3.12-slim
WORKDIR /app
# System deps needed by some Python packages
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install Poetry (pinned for reproducibility)
RUN pip install --no-cache-dir poetry==1.8.2
# Copy dependency files first (layer caching)
COPY pyproject.toml poetry.lock ./
# Install only production deps, no virtualenv needed inside container
RUN poetry config virtualenvs.create false \
&& poetry install --only main --no-interaction --no-ansi
# Copy the rest of the application
COPY . .
# ENTRYPOINT is python — CMD is overridden per Step Functions step
ENTRYPOINT ["python"]
CMD ["main.py"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment