|
|
@ -1,27 +1,39 @@ |
|
|
|
# NOTE: Use the run-container.sh script to build and launch this container. |
|
|
|
# NOTE: Use the run-container.sh script to build and launch this container. |
|
|
|
|
|
|
|
|
|
|
|
FROM python:alpine3.6 |
|
|
|
# We do a multi-stage build (requires Docker >= 17.05) to install everything, then copy it all |
|
|
|
|
|
|
|
# to the final target image. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FROM python:alpine3.6 AS base |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FROM base AS build |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# install the requirements |
|
|
|
# NOTE: pillow needs zlib and jpeg, lxml needs libxslt, we need build-base for gcc, etc. |
|
|
|
# NOTE: pillow needs zlib and jpeg, lxml needs libxslt, we need build-base for gcc, etc. |
|
|
|
RUN apk add --no-cache build-base zlib-dev jpeg-dev libxslt-dev |
|
|
|
RUN apk add --no-cache build-base zlib-dev jpeg-dev libxslt-dev |
|
|
|
ENV LIBRARY_PATH=/lib:/usr/lib |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# install the application requirements |
|
|
|
|
|
|
|
COPY requirements.txt requirements-dev.txt ./ |
|
|
|
|
|
|
|
RUN pip install -r requirements.txt |
|
|
|
ARG ENABLE_TESTS |
|
|
|
ARG ENABLE_TESTS |
|
|
|
|
|
|
|
RUN if [ "$ENABLE_TESTS" ]; then pip install -r requirements-dev.txt ; fi |
|
|
|
|
|
|
|
|
|
|
|
# install the Python requirements |
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
|
|
COPY requirements.txt requirements-dev.txt ./ |
|
|
|
|
|
|
|
RUN pip install -r requirements.txt ; \ |
|
|
|
FROM base |
|
|
|
if [ "$ENABLE_TESTS" ]; then pip install -r requirements-dev.txt ; fi |
|
|
|
COPY --from=build /usr/local/lib/python3.6/site-packages /usr/local/lib/python3.6/site-packages |
|
|
|
|
|
|
|
RUN apk add --no-cache libjpeg |
|
|
|
|
|
|
|
|
|
|
|
# install the application |
|
|
|
# install the application |
|
|
|
ADD vasl_templates vasl_templates |
|
|
|
WORKDIR /app |
|
|
|
COPY setup.py LICENSE.txt ./ |
|
|
|
COPY vasl_templates vasl_templates |
|
|
|
|
|
|
|
COPY setup.py requirements.txt requirements-dev.txt LICENSE.txt ./ |
|
|
|
RUN pip install -e . |
|
|
|
RUN pip install -e . |
|
|
|
|
|
|
|
|
|
|
|
# copy the config files |
|
|
|
# copy the config files |
|
|
|
COPY docker/config/* vasl_templates/webapp/config/ |
|
|
|
COPY docker/config/* vasl_templates/webapp/config/ |
|
|
|
|
|
|
|
ARG ENABLE_TESTS |
|
|
|
RUN if [ "$ENABLE_TESTS" ]; then echo "ENABLE_REMOTE_TEST_CONTROL = 1" >>vasl_templates/webapp/config/debug.cfg ; fi |
|
|
|
RUN if [ "$ENABLE_TESTS" ]; then echo "ENABLE_REMOTE_TEST_CONTROL = 1" >>vasl_templates/webapp/config/debug.cfg ; fi |
|
|
|
|
|
|
|
|
|
|
|
EXPOSE 5010 |
|
|
|
EXPOSE 5010 |
|
|
|