This repository was archived by the owner on Apr 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (36 loc) · 1.41 KB
/
Dockerfile
File metadata and controls
48 lines (36 loc) · 1.41 KB
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
FROM docker.io/library/python:3.8-slim-bullseye as base
FROM base as builder
# Install dependencies for building python dependencies
RUN apt-get update \
&& apt-get install -y libmariadb-dev gcc
# We install the application dependencies in this directory
WORKDIR /install
# First install the dependencies, so if they don't change, no new layers are created
COPY requirements.txt /install
RUN pip3 install --no-cache-dir --prefix=/install -r requirements.txt
FROM base
# Install tini, a mini-init to run forking applications in and runtime dependencies
RUN apt-get update \
&& apt-get install -y tini locales libmariadb3 \
&& echo 'de_DE.UTF-8 UTF-8' > /etc/locale.gen \
&& locale-gen \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# We run the application from this directory
WORKDIR /app
# Add all the other files to /app
COPY --from=builder /install /usr/local
COPY ./ /app
EXPOSE 5000
# Setup localization
ENV LANG="de_DE.UTF-8" TZ="Europe/Berlin"
# Setup flask
ENV FLASK_APP=webapp/app.py FLASK_ENV=production
# XXX: Runtime environment different from dev env
ENV PYTHONPATH=/app
ENTRYPOINT ["tini", "--", "/usr/local/bin/flask"]
CMD ["run", "-h", "0.0.0.0", "-p", "5000"]
LABEL org.opencontainers.image.authors="Daniela Grammlich <grammlich@synyx.de>" \
org.opencontainers.image.url=${CI_PROJECT_URL} \
org.opencontainers.image.vendor="synyx GmbH & Co. KG" \
org.opencontainers.image.title="rabenyx"