-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.backend
More file actions
29 lines (23 loc) · 886 Bytes
/
Dockerfile.backend
File metadata and controls
29 lines (23 loc) · 886 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
# Backend + API Server Container
FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*
# Set working directory — backend source lives here
WORKDIR /app
# Copy and install Python requirements
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy backend source code directly into /app
# (config.py's __file__-based path resolution will map Data/ → /Data, config/ → /config)
COPY backend/ /app/
# Expose API port
EXPOSE 8000
# 1. Collect AWS data via service_info.py
# 2. Start FastAPI server when collection is done
CMD ["bash", "-c", \
"echo '=== Starting AWS data collection ===' && \
python3 service_info.py && \
echo '=== Data collection complete! Starting API server ===' && \
exec python3 -m uvicorn api_server:app --host 0.0.0.0 --port 8000"]