2022-11-07 21:17:05 +00:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
|
|
|
|
# This Dockerfile builds a docker image containing all dependecies to run
|
|
|
|
# a development version of the lumi application.
|
|
|
|
|
|
|
|
FROM python:3
|
|
|
|
|
2022-12-01 13:36:27 +00:00
|
|
|
# Create non-root user
|
|
|
|
ARG LUMI2_UID
|
|
|
|
ARG LUMI2_GID
|
|
|
|
ENV LUMI2_USERNAME=lumi2
|
|
|
|
ENV LUMI2_GROUPNAME=lumi2
|
|
|
|
RUN groupadd --gid ${LUMI2_GID:-1000} ${LUMI2_GROUPNAME} && \
|
|
|
|
useradd --uid ${LUMI2_UID:-1000} --gid ${LUMI2_GID:-1000} --no-create-home --shell /bin/bash ${LUMI2_USERNAME} && \
|
|
|
|
mkdir /app && chown ${LUMI2_UID:-1000}:${LUMI2_GID:-1000} /app
|
|
|
|
|
|
|
|
# Copy source files
|
2022-11-07 21:17:05 +00:00
|
|
|
WORKDIR /app
|
2022-12-01 13:36:27 +00:00
|
|
|
COPY --chown=${LUMI2_USERNAME}:${LUMI2_GROUPNAME} requirements.txt /app/
|
|
|
|
COPY --chown=${LUMI2_USERNAME}:${LUMI2_GROUPNAME} lumi2 /app/lumi2/
|
|
|
|
COPY --chown=${LUMI2_USERNAME}:${LUMI2_GROUPNAME} tests /app/tests/
|
|
|
|
COPY --chown=${LUMI2_USERNAME}:${LUMI2_GROUPNAME} pytest.ini /app/
|
|
|
|
|
|
|
|
# Install dependencies
|
2022-11-07 21:17:05 +00:00
|
|
|
RUN pip install -r requirements.txt
|
2022-12-01 13:36:27 +00:00
|
|
|
|
|
|
|
# Launch WSGI server
|
|
|
|
USER ${LUMI2_UID:-1000}:${LUMI2_GID:-1000}
|
2022-12-01 01:28:44 +00:00
|
|
|
ENTRYPOINT ["waitress-serve", "--listen=0.0.0.0:80", "--no-ipv6", "--call", "lumi2:create_app"]
|