-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile-backend
More file actions
59 lines (45 loc) · 1.69 KB
/
Copy pathDockerfile-backend
File metadata and controls
59 lines (45 loc) · 1.69 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
49
50
51
52
53
54
55
56
FROM python:3.12-slim
LABEL maintainer="Alessio Gerace <a.gerace@inrim.it>"
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
DEBIAN_FRONTEND=noninteractive
ARG TZ
ARG REQUIREMENTS
ENV REQUIREMENTS_SCRIPT=${REQUIREMENTS}
# --- Timezone ---
RUN if [ -f /etc/apt/sources.list.d/debian.sources ]; then \
sed -i 's|http://deb.debian.org|https://deb.debian.org|g' /etc/apt/sources.list.d/debian.sources; \
fi && \
if [ -f /etc/apt/sources.list ]; then \
sed -i 's|http://deb.debian.org|https://deb.debian.org|g' /etc/apt/sources.list; \
fi && \
apt-get update && \
apt-get install -y --no-install-recommends tzdata && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# --- Base dependencies ---
RUN if [ -f /etc/apt/sources.list.d/debian.sources ]; then \
sed -i 's|http://deb.debian.org|https://deb.debian.org|g' /etc/apt/sources.list.d/debian.sources; \
fi && \
if [ -f /etc/apt/sources.list ]; then \
sed -i 's|http://deb.debian.org|https://deb.debian.org|g' /etc/apt/sources.list; \
fi && \
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential python3-dev git wget \
ldap-utils libldap2-dev libsasl2-dev \
gcc g++ locales locales-all && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# --- Locale ---
ENV LC_ALL=it_IT.UTF-8 \
LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8
# --- Workdir e app ---
WORKDIR /apps
COPY ./start.sh /start.sh
COPY ./gunicorn_conf.py /gunicorn_conf.py
COPY . /apps
RUN /apps/$REQUIREMENTS_SCRIPT 'backend'
ENV PYTHONPATH=/app
WORKDIR /app
ENTRYPOINT ["/start.sh"]