Skip to content

Instantly share code, notes, and snippets.

@martinda
Created January 1, 2017 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinda/abc4cf3dc6fb5ace70b75cd93fcc0fc2 to your computer and use it in GitHub Desktop.
Save martinda/abc4cf3dc6fb5ace70b75cd93fcc0fc2 to your computer and use it in GitHub Desktop.
Trying to figure out some best practice for running python tests
FROM python@sha256:d7728edb9e52abc58552cec26d871f474394f3ffdefbe2929da93bfa42d92b1f
# Where the project files will be installed and tested inside the container
WORKDIR /usr/local/plowapp
# Copy the project files to the WORKDIR
COPY . .
# The python version in the container is owned by the OS of the container
# We need to isolate our project from the OS requirements by installing the virtualenv
RUN pip install virtualenv==15.1.0
# Setup the venv and install the requirements in the venv
RUN virtualenv venv && \
. venv/bin/activate && \
pip install -r requirements.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment