Skip to content

Commit

Permalink
feat: slim down image
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Bluhm <[email protected]>
  • Loading branch information
dbluhm committed Apr 15, 2022
1 parent 7940594 commit ea6a354
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM python:3.7 AS base
FROM python:3.7-slim-bullseye AS base
WORKDIR /app

# Install and configure poetry
ENV POETRY_VERSION=1.1.11
ENV POETRY_HOME=/opt/poetry
RUN apt update && apt install -y curl && apt clean
RUN curl -sSL https://install.python-poetry.org | python -

ENV PATH="/opt/poetry/bin:$PATH"
Expand All @@ -14,10 +15,12 @@ RUN mkdir src && touch src/__init__.py
COPY pyproject.toml poetry.lock README.md ./
RUN poetry install --no-dev -E server

FROM python:3.7
FROM python:3.7-slim-bullseye
LABEL healthcheck="nc -z 127.0.0.1 80"
WORKDIR /app
COPY --from=base /app/.venv /app/.venv
ENV PATH="/app/.venv/bin:$PATH"
RUN apt update && apt install -y netcat && apt clean
EXPOSE 80

COPY src src
Expand Down

0 comments on commit ea6a354

Please sign in to comment.