|
|
|
@ -7,15 +7,19 @@ FROM ${DOCKER_CACHE}python:3.8 |
|
|
|
|
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 apt-get update && apt-get -y full-upgrade && apt-get install -y netcat |
|
|
|
|
|
|
|
|
|
ARG DEBUG=false |
|
|
|
|
RUN if [ "$DEBUG" = "true" ] ; then apt-get install -y graphviz libgraphviz-dev; fi |
|
|
|
|
|
|
|
|
|
# Create an app user in the app group. |
|
|
|
|
RUN useradd --user-group --create-home --no-log-init --shell /bin/bash app |
|
|
|
|
ENV APP_HOME=/home/app/web |
|
|
|
|
ARG DEBUG="False" |
|
|
|
|
ENV DEBUG="${DEBUG}" |
|
|
|
|
RUN if [ "$DEBUG" = "True" ] ; then apt-get install -y graphviz libgraphviz-dev; fi |
|
|
|
|
|
|
|
|
|
# Create a logfile dir... not sure if this is the right way |
|
|
|
|
RUN mkdir -p ${APP_HOME}/../log |
|
|
|
@ -37,18 +41,13 @@ 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 |
|
|
|
|
|
|
|
|
|
# Startup script when the image is starting up with |
|
|
|
|
COPY ./docker/entrypoint.api.sh ${APP_HOME}/entrypoint.api.sh |
|
|
|
|
RUN chmod +x ${APP_HOME}/entrypoint.api.sh |
|
|
|
|
|
|
|
|
|
# fix file rights |
|
|
|
|
RUN chown -R app:app $APP_HOME/../ |
|
|
|
|
|
|
|
|
|
# Run as user (this will not work with Drones testing) |
|
|
|
|
#USER app:app |
|
|
|
|
|
|
|
|
|
# ENTRYPOINT does not work with variables..?? (${APP_HOME}) |
|
|
|
|
ENTRYPOINT ["/home/app/web/entrypoint.api.sh"] |
|
|
|
|
ENTRYPOINT ["/opt/VRE/entrypoint.api.sh"] |
|
|
|
|
# Strange exit errors.... |
|
|
|
|
#ENTRYPOINT ["sh","-c","${APP_HOME}/entrypoint.api.sh"] |