-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (31 loc) · 879 Bytes
/
Dockerfile
File metadata and controls
40 lines (31 loc) · 879 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
35
36
37
38
39
40
FROM python:3.12-slim-bookworm AS builder
WORKDIR /EEW
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
libffi-dev \
libgdal-dev \
libgeos-dev \
libproj-dev \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip wheel && \
pip install --no-cache-dir -r requirements.txt
FROM python:3.12-slim-bookworm
WORKDIR /EEW
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PROJ_DATA=/usr/share/proj \
PATH="/opt/venv/bin:$PATH"
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libgeos-c1v5 \
libproj25 \
libpq5 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /opt/venv /opt/venv
COPY . .
CMD ["python", "main.py"]