-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (32 loc) · 1.09 KB
/
Dockerfile
File metadata and controls
47 lines (32 loc) · 1.09 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
# Frontend build stage
FROM node:22-alpine AS frontend-build
WORKDIR /frontend
COPY frontend/package*.json ./
RUN npm install
COPY frontend/ .
RUN npm run build
# Runtime: Python backend + nginx
FROM python:3.11-slim
ENV APP_HOME=/app
ENV PYTHONPATH="$APP_HOME/core" \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR $APP_HOME
# System dependencies (nginx + utilities)
RUN apt-get update && \
apt-get install -y --no-install-recommends nginx && \
rm -rf /var/lib/apt/lists/*
# Copy backend core and other necessary files
COPY core/ ./core/
COPY nginx.conf /etc/nginx/nginx.conf
# Install dependencies for the backend
WORKDIR $APP_HOME/core
COPY core/requirements.txt ./requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy frontend build into nginx
COPY --from=frontend-build /frontend/dist /usr/share/nginx/html
# Copy app version file (served statically by nginx at /version/app)
COPY VERSION.json /usr/share/nginx/html/version.json
EXPOSE 80
# Run both nginx and the Python backend
CMD ["sh", "-c", "nginx -g 'daemon off;' & python -m edge_mining standard"]