-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (22 loc) · 876 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
# syntax=docker/dockerfile:1
FROM python:3.11-bullseye
# Install GDAL dependencies
RUN apt-get update &&\
apt-get install -y binutils libproj-dev gdal-bin --no-install-recommends \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /app
WORKDIR /app
RUN pip install --no-cache-dir poetry==1.4.2 && poetry config virtualenvs.create false
COPY poetry.lock pyproject.toml README.md /app/
# to prevent poetry from installing my actual app,
# and keep docker able to cache layers
RUN mkdir -p /app/src/app && touch /app/src/app/__init__.py && poetry install -n
# now actually copy the real contents of my app
COPY . /app/src/app
# start server
EXPOSE 8000
STOPSIGNAL SIGTERM
WORKDIR /app/src/app
RUN ./manage.py collectstatic --noinput --clear --settings project.settings.production
CMD ["gunicorn", "--bind", ":8000", "--workers", "3", "project.wsgi"]