Skip to content

Instantly share code, notes, and snippets.

@Lauriy
Created July 29, 2024 20:51
Show Gist options
  • Save Lauriy/266f732ea64345343b9ed166c6885ffd to your computer and use it in GitHub Desktop.
Save Lauriy/266f732ea64345343b9ed166c6885ffd to your computer and use it in GitHub Desktop.
Django runserver & pytest Dockerfile layer
FROM base AS development
# Django's built-in development server
EXPOSE 8000
COPY requirements.test.txt pytest.ini ./
RUN --mount=type=cache,target=/root/.cache/pip pip install --no-cache-dir -r requirements.test.txt \
&& rm -rf requirements.test.txt
# We need the main source code to do anything useful
COPY rik_proovitöö ./rik_proovitöö
# TDD is a thing these days I hear, also allows us to reuse this stage for both 'dev' and 'test' profiles
COPY rik_proovitöö_tests ./rik_proovitöö_tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment