-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
57 lines (43 loc) · 1.63 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM registry.gitlab.com/geo-bl-ch/docker/python:alpine-3.19 AS builder
USER 0
RUN apk update && \
apk upgrade && \
apk add \
bash \
bash-completion \
shadow \
build-base \
nodejs \
npm \
uwsgi-python3 \
python3-dev
COPY . /app
WORKDIR /app
RUN python3 -m venv .venv && \
.venv/bin/pip install --upgrade pip && \
.venv/bin/pip install wheel && \
.venv/bin/pip install pyyaml && \
.venv/bin/pip install -e . && \
npm install --legacy-peer-deps && \
./node_modules/.bin/vite build
USER 1001
FROM registry.gitlab.com/geo-bl-ch/docker/python:alpine-3.19
USER 0
RUN apk update && \
apk upgrade && \
apk add \
bash \
uwsgi-python3
COPY --from=builder --chown=1001:0 /app/.venv /app/.venv
COPY --from=builder --chown=1001:0 /app/oereb_client/*.py /app/oereb_client/
COPY --from=builder --chown=1001:0 /app/oereb_client/templates /app/oereb_client/templates
COPY --from=builder --chown=1001:0 /app/oereb_client/views /app/oereb_client/views
COPY --from=builder --chown=1001:0 /app/oereb_client/static/i18n /app/oereb_client/static/i18n
COPY --from=builder --chown=1001:0 /app/oereb_client/static/images /app/oereb_client/static/images
COPY --from=builder --chown=1001:0 /app/oereb_client/static/build /app/oereb_client/static/build
COPY --from=builder --chown=1001:0 /app/oereb_client.egg-info /app/oereb_client.egg-info
COPY --from=builder --chown=1001:0 /app/app.ini /app/app.ini
ENV PATH="/app/.local/bin:${PATH}"
EXPOSE 8080
USER 1001
CMD ["uwsgi", "--plugin", "python3", "--http-socket", "0.0.0.0:8080", "--ini-paste-logged", "/app/app.ini"]