6 changed files with 66 additions and 82 deletions
@ -1,40 +0,0 @@
@@ -1,40 +0,0 @@
|
||||
# Use the official Python image from the Docker Hub. But cached by the RUG registry to not to hit rate limits |
||||
# Use build args: DOCKER_CACHE=registry.webhosting.rug.nl/cache/library/ |
||||
ARG DOCKER_CACHE |
||||
FROM ${DOCKER_CACHE}python:3.8 |
||||
|
||||
# These two environment variables prevent __pycache__/ files. |
||||
ENV PYTHONUNBUFFERED 1 |
||||
ENV PYTHONDONTWRITEBYTECODE 1 |
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive |
||||
|
||||
ENV APP_HOME=/opt/VRE |
||||
ENV VIRTUAL_ENV=/opt/venv |
||||
RUN python3 -m venv $VIRTUAL_ENV |
||||
ENV PATH="$VIRTUAL_ENV/bin:$PATH" |
||||
|
||||
# Update packages and install nc for database up detection |
||||
RUN rm -rf /var/lib/apt/lists/* && apt-get update && apt-get -y full-upgrade |
||||
|
||||
ARG DEBUG="False" |
||||
ENV DEBUG="${DEBUG}" |
||||
RUN if [ "$DEBUG" = "True" ] ; then apt-get install -y graphviz libgraphviz-dev; fi |
||||
|
||||
RUN apt-get autoremove -y && rm -rf /var/lib/apt/lists/* |
||||
|
||||
# Create a logfile dir... not sure if this is the right way |
||||
RUN mkdir -p ${APP_HOME}/../log |
||||
|
||||
# Change the workdir. |
||||
WORKDIR ${APP_HOME} |
||||
|
||||
# Copy the code. |
||||
COPY ./VRE/. ${APP_HOME} |
||||
|
||||
# Upgrade pip |
||||
RUN pip install --upgrade pip wheel |
||||
|
||||
# Install the requirements. |
||||
RUN pip install --no-cache-dir -r requirements.txt |
||||
RUN if [ "$DEBUG" = "True" ] ; then pip install --no-cache-dir -r requirements-dev.txt; fi |
Loading…
Reference in new issue