2021-06-17 11:52:13 +02:00
|
|
|
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 && \
|
|
|
|
pip3 install psycopg2 && \
|
|
|
|
pip3 install dateparser && \
|
|
|
|
pip3 install connexion && \
|
|
|
|
pip3 install connexion[swagger-ui] && \
|
|
|
|
pip3 install uwsgi && \
|
|
|
|
pip3 install flask-cors && \
|
|
|
|
pip3 install python-jose[cryptography] && \
|
2021-07-07 13:02:16 +02:00
|
|
|
pip3 install loguru && \
|
|
|
|
pip3 install Cheetah3
|
2021-06-17 11:52:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RUN \
|
|
|
|
mkdir -p ${APP_DIR} && \
|
|
|
|
mkdir -p ${CONF_DIR} && \
|
2021-07-07 13:07:51 +02:00
|
|
|
useradd -d ${APP_DIR} -u 1000 user
|
2021-06-17 11:52:13 +02:00
|
|
|
|
|
|
|
COPY *.py ${APP_DIR}/
|
2021-07-07 13:02:16 +02:00
|
|
|
COPY openapi.yaml.tmpl ${APP_DIR}/
|
|
|
|
COPY methods.py.tmpl ${APP_DIR}/
|
|
|
|
COPY schema.json ${APP_DIR}/
|
2021-06-17 11:52:13 +02:00
|
|
|
COPY server.ini ${CONF_DIR}/
|
|
|
|
|
|
|
|
WORKDIR ${APP_DIR}
|
|
|
|
VOLUME ${CONF_DIR}
|
|
|
|
|
2021-07-07 13:02:16 +02:00
|
|
|
RUN \
|
|
|
|
python3 generate.py
|
2021-07-07 13:05:30 +02:00
|
|
|
|
2021-07-07 13:07:51 +02:00
|
|
|
USER 1000:1000
|
2021-07-07 13:02:16 +02:00
|
|
|
|
2021-06-17 11:52:13 +02:00
|
|
|
EXPOSE 5000
|
|
|
|
EXPOSE 9191
|
|
|
|
|
|
|
|
CMD [ "uwsgi", "./config/server.ini" ]
|
|
|
|
|
|
|
|
|
|
|
|
|