-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (19 loc) · 907 Bytes
/
Dockerfile
File metadata and controls
25 lines (19 loc) · 907 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
FROM inseefrlab/onyxia-python-pytorch:py3.13.12-gpu
ENV TIMEOUT=3600
ENV PROJ_LIB=/opt/conda/share/proj
ENV PATH="/api/.venv/bin:$PATH"
# set api as the current work dir
WORKDIR /api
# copy uv
COPY pyproject.toml pyproject.toml
COPY uv.lock uv.lock
# install
RUN uv sync --frozen && \
wget -q -O /api/nuts_2021.gpkg https://minio.lab.sspcloud.fr/projet-hackathon-ntts-2025/NUTS_RG_01M_2021_4326_LEVL_3.gpkg
# copy the main code of fastapi
COPY ./app /api/app
# launch the unicorn server to run the api
# If you are running your container behind a TLS Termination Proxy (load balancer) like Nginx or Traefik,
# add the option --proxy-headers, this will tell Uvicorn to trust the headers sent by that proxy telling it
# that the application is running behind HTTPS, etc.
CMD ["uvicorn", "app.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "8000", "--timeout-graceful-shutdown", "3600"]