-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (39 loc) · 1.21 KB
/
Copy pathDockerfile
File metadata and controls
50 lines (39 loc) · 1.21 KB
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
41
42
43
44
45
46
47
48
49
50
# ---- Frontend build stage ----
FROM node:24-bookworm-slim AS frontend
WORKDIR /src/frontend
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
COPY frontend/ .
RUN npm run build
# ---- Backend build stage ----
FROM python:3.11-slim-bookworm AS builder
WORKDIR /src/backend
COPY backend/ .
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
pkg-config \
libsodium-dev \
libffi-dev \
libssl-dev \
libxml2-dev \
libxslt1-dev \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir .
# ---- Runtime stage ----
FROM python:3.11-slim-bookworm
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
libsodium23 \
libffi8 \
libssl3 \
libxml2 \
libxslt1.1 \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install backend (with bundled geodata) and copy frontend build
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
COPY --from=builder /usr/local/bin/maparr /usr/local/bin/maparr
COPY --from=frontend /src/frontend/dist ./frontend/dist
EXPOSE 8000
CMD ["maparr", "--host", "0.0.0.0", "--port", "8000"]