-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (27 loc) · 1.01 KB
/
Copy pathDockerfile
File metadata and controls
39 lines (27 loc) · 1.01 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
# syntax=docker/dockerfile:1
FROM node:22-alpine AS web-deps
WORKDIR /app
COPY package*.json ./
RUN npm ci
FROM web-deps AS web-build
WORKDIR /app
COPY index.html vite.config.ts tsconfig.json ./
COPY src ./src
RUN npm run build
FROM python:3.12-slim AS runtime
WORKDIR /app
ENV PYTHONUNBUFFERED=1 \
DDDS_STATIC_DIR=/app/static \
DDDS_MODEL_PATH=/app/backend/models/drone_detector_model_v2.pkl \
DDDS_SAMPLES_DIR=/app/backend/samples
RUN apt-get update \
&& apt-get install -y --no-install-recommends libsndfile1 \
&& rm -rf /var/lib/apt/lists/*
COPY backend/requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt
COPY backend ./backend
COPY --from=web-build /app/dist ./static
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/api/health', timeout=3)" || exit 1
CMD ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "8000"]