Skip to content

Instantly share code, notes, and snippets.

@Alexei-Kornienko
Last active December 21, 2022 08:17
Show Gist options
  • Save Alexei-Kornienko/b048cc969798428740658393018e91c9 to your computer and use it in GitHub Desktop.
Save Alexei-Kornienko/b048cc969798428740658393018e91c9 to your computer and use it in GitHub Desktop.
FROM python:3-slim as prod_base
WORKDIR /app
ENV PYTHONUNBUFFERED True
COPY requirements.txt .
RUN pip install -r requirements.txt
FROM prod_base as test_base
COPY test-requirements.txt .
RUN pip install -r test-requirements.txt
FROM prod_base as prod
COPY src/ .
ARG version=unknown
RUN echo $version && sed -i "s/##VERSION##/$version/g" __init__.py
FROM test_base as test
COPY src/ .
COPY test ./test
COPY fixtures /fixtures
COPY specs /specs
COPY config /config
ARG version=unknown
RUN echo $version && sed -i "s/##VERSION##/$version-dev/g" __init__.py
FROM prod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment