2023-01-16 09:30:21 +00:00
|
|
|
FROM python:3.11-alpine
|
2022-12-16 12:55:17 +00:00
|
|
|
|
2023-05-09 04:57:03 +00:00
|
|
|
ARG VERSION
|
|
|
|
ARG COMMIT=""
|
|
|
|
RUN echo -e "VERSION=$VERSION\nCOMMIT=$COMMIT" > /version.env
|
|
|
|
|
2022-12-16 12:55:17 +00:00
|
|
|
COPY requirements.txt /tmp/requirements.txt
|
|
|
|
|
|
|
|
RUN apk update \
|
2023-07-04 09:06:00 +00:00
|
|
|
&& apk add --no-cache --virtual build-deps gcc g++ python3-dev musl-dev pkgconfig \
|
|
|
|
&& apk add --no-cache curl postgresql postgresql-dev mariadb-dev sqlite-dev \
|
2022-12-16 12:55:17 +00:00
|
|
|
&& pip install --no-cache-dir --upgrade uvicorn \
|
2024-03-04 20:13:12 +00:00
|
|
|
&& pip install --no-cache-dir psycopg2==2.9.9 mysqlclient==2.2.4 pysqlite3==0.5.2 \
|
2022-12-16 12:55:17 +00:00
|
|
|
&& pip install --no-cache-dir -r /tmp/requirements.txt \
|
|
|
|
&& apk del build-deps
|
|
|
|
|
|
|
|
COPY app /app
|
2022-12-21 06:33:20 +00:00
|
|
|
COPY README.md /README.md
|
2022-12-16 12:55:17 +00:00
|
|
|
|
2022-12-29 09:31:25 +00:00
|
|
|
HEALTHCHECK --start-period=30s --interval=10s --timeout=5s --retries=3 CMD curl --insecure --fail https://localhost/-/health || exit 1
|
2022-12-19 13:33:23 +00:00
|
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "443", "--app-dir", "/app", "--proxy-headers", "--ssl-keyfile", "/app/cert/webserver.key", "--ssl-certfile", "/app/cert/webserver.crt"]
|