Skip to content

Commit eaea1bd

Browse files
committed
Update Docker image setup
The fastapi author recommends no longer using the gunicorn-uvicorn base image but to instead rely on the built-in version of uvicorn in fastapi. https://hub.docker.com/r/tiangolo/uvicorn-gunicorn-fastapi
1 parent 39d89db commit eaea1bd

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Dockerfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8
1+
FROM python:3.12
22

33
COPY ./requirements.txt /requirements.txt
44

5+
RUN apt-get update
6+
RUN apt-get install postgresql-client libgeos-dev --yes
7+
58
RUN pip install -r /requirements.txt
69

7-
RUN apt-get update
8-
RUN apt-get install postgresql-client --yes
910

1011
COPY ./app /app/app
1112
COPY ./prestart.sh /app/prestart.sh
1213

14+
CMD ["fastapi", "run", "/app/app/main.py", "--port", "80", "--workers", "4"]

requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
fastapi==0.109.1
1+
fastapi[standard]==0.115.8
22
GeoAlchemy2==0.15.1
33
psycopg2==2.9.9
44
pydantic==2.7.4
55
Shapely==1.7.1
6-
SQLAlchemy==2.0.31
6+
SQLAlchemy==2.0.31

0 commit comments

Comments
 (0)