generated from geoadmin/template-service-flask
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
37 lines (28 loc) · 839 Bytes
/
Dockerfile
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
30
31
32
33
34
35
36
37
# Buster slim python 3.12 base image.
FROM python:3.12-slim-bookworm
ENV HTTP_PORT 8080
RUN groupadd -r geoadmin && useradd -r -s /bin/false -g geoadmin geoadmin
# HERE : install relevant packages
RUN pip3 install pipenv \
&& pipenv --version
COPY Pipfile* /tmp/
RUN cd /tmp && \
pipenv install --system --deploy --ignore-pipfile
WORKDIR /app
COPY --chown=geoadmin:geoadmin ./ /app/
ARG GIT_HASH=unknown
ARG GIT_BRANCH=unknown
ARG GIT_DIRTY=""
ARG VERSION=unknown
ARG AUTHOR=unknown
LABEL git.hash=$GIT_HASH
LABEL git.branch=$GIT_BRANCH
LABEL git.dirty="$GIT_DIRTY"
LABEL version=$VERSION
LABEL author=$AUTHOR
# Overwrite the version.py from source with the actual version
RUN echo "APP_VERSION = '$VERSION'" > /app/app/version.py
USER geoadmin
EXPOSE $HTTP_PORT
# Use a real WSGI server
ENTRYPOINT ["python3", "wsgi.py"]