-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (33 loc) · 950 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
FROM python:3.11-slim-bookworm
ENV USER=sccity
ENV GROUPNAME=$USER
ENV UID=1435
ENV GID=1435
WORKDIR /app
RUN addgroup \
--gid "$GID" \
"$GROUPNAME" \
&& adduser \
--disabled-password \
--gecos "" \
--home "/app" \
--ingroup "$GROUPNAME" \
--no-create-home \
--uid "$UID" \
$USER
RUN apt-get update \
&& apt-get install -y \
curl \
libodbc2 \
&& echo "deb [arch=amd64 trusted=yes] https://packages.microsoft.com/debian/12/prod bookworm main" \
> /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update \
&& ACCEPT_EULA=Y apt-get install -y --allow-unauthenticated msodbcsql17
COPY ./requirements.txt /app
RUN pip install --no-cache-dir -r requirements.txt
COPY . /app
RUN chown -R sccity:sccity /app && chmod -R 775 /app
USER sccity
EXPOSE 5000
HEALTHCHECK --interval=30s --timeout=5s CMD timeout 10s bash -c ':> /dev/tcp/127.0.0.1/5000' || exit 1
CMD ["python", "-u", "app.py"]