-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (20 loc) · 794 Bytes
/
Dockerfile
File metadata and controls
29 lines (20 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#########################################################################
# Mount a config.json file into the container if running outside of K8s #
#########################################################################
FROM python:3.12-alpine
ARG SERVICE_USER="paso"
ARG SERVICE_GROUP="$SERVICE_USER"
# These must be set to match the permissions provided within k8s
ARG UID=1000
ARG GID=1000
USER root
WORKDIR /app
RUN apk update && apk upgrade
RUN pip install pipenv flask gunicorn mysql-connector datetime
COPY api.py log.sh ./
COPY html html
EXPOSE 80
RUN adduser --disabled-password -u $UID -g $GID $SERVICE_USER $SERVICE_GROUP && chown -R $SERVICE_USER /app
USER $SERVICE_USER
ENV PYTHONPATH="/app"
ENTRYPOINT ["gunicorn", "-w", "4", "-b", ":80", "api:app"]