39 lines
685 B
Docker
39 lines
685 B
Docker
FROM python:latest
|
|
|
|
LABEL Maintainer="Wolfgang Hottgenroth wolfgang.hottgenroth@icloud.com"
|
|
LABEL ImageName="registry.hottis.de/hv2/hv2-api"
|
|
|
|
ARG APP_DIR="/opt/app"
|
|
ARG CONF_DIR="${APP_DIR}/config"
|
|
|
|
|
|
|
|
RUN \
|
|
apt update && \
|
|
apt install -y postgresql-client-common && \
|
|
mkdir -p ${APP_DIR} && \
|
|
mkdir -p ${CONF_DIR} && \
|
|
useradd -d ${APP_DIR} -u 1000 user
|
|
|
|
COPY *.py ${APP_DIR}/
|
|
COPY openapi.yaml ${APP_DIR}/
|
|
COPY methods.py ${APP_DIR}/
|
|
COPY requirements.txt ${APP_DIR}/
|
|
COPY server.ini ${CONF_DIR}/
|
|
|
|
WORKDIR ${APP_DIR}
|
|
VOLUME ${CONF_DIR}
|
|
|
|
RUN \
|
|
pip3 install -r requirements.txt
|
|
|
|
USER 1000:1000
|
|
|
|
EXPOSE 5000
|
|
EXPOSE 9191
|
|
|
|
CMD [ "uwsgi", "./config/server.ini" ]
|
|
|
|
|
|
|