Skip to content

Commit

Permalink
Modify service Dockerfile as no longer require developer stage
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Nov 14, 2024
1 parent 64066be commit c59b15a
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
# The devcontainer should use the developer target and run as root with podman
# or docker with user namespaces.
ARG PYTHON_VERSION=3.11
FROM python:${PYTHON_VERSION} as developer

# Add any system dependencies for the developer/build environment here
RUN apt-get update && apt-get install -y --no-install-recommends \
graphviz \
&& rm -rf /var/lib/apt/lists/*

# Set up a virtual environment and put it in PATH
RUN python -m venv /venv
ENV PATH=/venv/bin:$PATH

# The build stage installs the context into the venv
FROM developer as build
FROM python:${PYTHON_VERSION} AS build
RUN python -m venv /venv;
COPY . /context
WORKDIR /context
RUN touch dev-requirements.txt && pip install --upgrade pip && pip install -c dev-requirements.txt .

# The runtime stage copies the built venv into a slim runtime container
FROM python:${PYTHON_VERSION}-slim as runtime
FROM python:${PYTHON_VERSION}-slim AS runtime
# Add apt-get system dependecies for runtime here if needed
RUN apt-get update && apt-get install -y --no-install-recommends \
# Git required for installing packages at runtime
Expand Down

0 comments on commit c59b15a

Please sign in to comment.