generated from EGI-Federation/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (25 loc) · 824 Bytes
/
Dockerfile
File metadata and controls
34 lines (25 loc) · 824 Bytes
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
FROM python:3.13-slim
# Install uv.
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
# Add Tini
# This avoids the healthcheck becoming zombie processes
# Ignoring DL3008 as we don't need to pin tini
# hadolint ignore=DL3008
RUN apt-get -y update && \
apt-get install --no-install-recommends \
-y tini && \
rm -rf /var/lib/apt/lists/*
RUN adduser python
USER python
# Install httpie for the healthcheck
RUN uv tool install httpie
# Copy the application into the container.
COPY --chown=python . /app
# Install the application dependencies.
WORKDIR /app
RUN uv sync --frozen --no-cache
EXPOSE 80/tcp
HEALTHCHECK CMD uv tool run --from httpie http localhost
# Run the application.
ENTRYPOINT ["tini", "--"]
CMD ["/app/.venv/bin/fastapi", "run", "app/main.py", "--port", "80", "--host", "0.0.0.0"]