-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (37 loc) · 1.32 KB
/
Dockerfile
File metadata and controls
50 lines (37 loc) · 1.32 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
# Multi-stage build for Dashboard Service
FROM node:20-slim as frontend-builder
WORKDIR /app
# Copy frontend package files
WORKDIR /app/frontend
COPY frontend/package*.json ./
RUN npm ci
# Copy frontend source and build
COPY frontend/ .
RUN npm run build && echo "✅ Frontend build successful" || (echo "❌ Frontend build failed" && exit 1)
# Python stage for dashboard API
FROM python:3.12-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install Python dependencies
COPY requirements-railway.txt .
RUN pip install --no-cache-dir -r requirements-railway.txt
# Copy backend source
COPY src/ ./src/
# Copy data files
COPY extracted_data/ ./extracted_data/
RUN echo "Copied extracted_data directory for dashboard"
RUN ls -la extracted_data/ | head -10
# Copy built frontend from frontend-builder stage
COPY --from=frontend-builder /app/frontend/dist ./frontend/dist
RUN echo "✅ Frontend copied to frontend/dist/"
RUN ls -la frontend/dist/ | head -5
# Health check - use a reasonable startup period
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD curl --fail http://localhost:8000/api/health || exit 1
# Expose port
EXPOSE 8000
# Run dashboard API server
CMD ["python", "src/api_server.py"]