-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (29 loc) · 1.01 KB
/
Dockerfile
File metadata and controls
41 lines (29 loc) · 1.01 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
FROM python:3.12-slim as builder
# System setup
RUN apt update -y
RUN apt install -y libffi-dev build-essential libsasl2-dev libpq-dev libldap-dev libjpeg-dev zlib1g-dev
WORKDIR /usr/src/app
# https://github.com/python-ldap/python-ldap/issues/432
RUN echo 'INPUT ( libldap.so )' > /usr/lib/libldap_r.so
# Copy source
COPY . .
## Python environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Dependencies
RUN pip3 install --user gunicorn wheel --no-cache-dir
RUN pip3 install --user -r requirements.txt --no-cache-dir
FROM python:3.12-slim
RUN apt update -y
RUN apt install -y supervisor curl postgresql-client argon2 tzdata cron
WORKDIR /usr/src/app
COPY --from=builder /root/.local /root/.local
COPY --from=builder /usr/src/app /usr/src/app
ENV PATH=/root/.local/bin:$PATH
## Configuration
COPY conf/supervisor.conf /etc/supervisord.conf
RUN chmod +x conf/entrypoint.sh
# Health check
#HEALTHCHECK CMD curl --fail http://localhost:9000/api/v1/status || exit 1
# Execution
CMD ["conf/entrypoint.sh"]