-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (21 loc) · 809 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
# syntax=docker/dockerfile:1
FROM python:3.11-slim-buster
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
WORKDIR /app
ARG CODE_HASH
RUN mkdir -p /app/logs
RUN mkdir -p /app/instance
RUN addgroup --gid 1000 --system app && adduser --uid 1000 --system --group app
COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir gunicorn mysql-connector-python
COPY proxycroak proxycroak
COPY wsgi.py wsgi.py
COPY manage.py manage.py
# Create the version filthe documentatione (baked into the container)
RUN echo -n "$(date +'%Y.%m.%d')\n$CODE_HASH" > /app/VERSION
EXPOSE 5000
RUN chown -R app:app /app
USER app
CMD ["gunicorn", "-w", "4", "--bind", "0.0.0.0:5000", "wsgi:application", "--error-logfile", "-", "--access-logfile", "-"]