Slim Docker: drop torch/chronos/streamlit (~2GB), 5x faster build
Browse files- Dockerfile +3 -2
- backend/Dockerfile +3 -2
- backend/requirements-docker.txt +12 -0
Dockerfile
CHANGED
|
@@ -3,9 +3,10 @@ FROM python:3.12-slim
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
# Install dependencies first (layer caching)
|
| 6 |
-
|
|
|
|
| 7 |
COPY backend/requirements.txt backend/
|
| 8 |
-
RUN pip install --no-cache-dir -r requirements.txt -r backend/requirements.txt
|
| 9 |
|
| 10 |
# Non-root user for security
|
| 11 |
RUN groupadd -r solarwine && useradd -r -g solarwine solarwine
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
# Install dependencies first (layer caching)
|
| 6 |
+
# Use slim requirements (no torch/chronos/streamlit — not needed at API runtime)
|
| 7 |
+
COPY backend/requirements-docker.txt backend/
|
| 8 |
COPY backend/requirements.txt backend/
|
| 9 |
+
RUN pip install --no-cache-dir -r backend/requirements-docker.txt -r backend/requirements.txt
|
| 10 |
|
| 11 |
# Non-root user for security
|
| 12 |
RUN groupadd -r solarwine && useradd -r -g solarwine solarwine
|
backend/Dockerfile
CHANGED
|
@@ -3,9 +3,10 @@ FROM python:3.12-slim
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
# Install dependencies first (layer caching)
|
| 6 |
-
|
|
|
|
| 7 |
COPY backend/requirements.txt backend/
|
| 8 |
-
RUN pip install --no-cache-dir -r requirements.txt -r backend/requirements.txt
|
| 9 |
|
| 10 |
# Non-root user for security
|
| 11 |
RUN groupadd -r solarwine && useradd -r -g solarwine solarwine
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
# Install dependencies first (layer caching)
|
| 6 |
+
# Use slim requirements (no torch/chronos/streamlit — not needed at API runtime)
|
| 7 |
+
COPY backend/requirements-docker.txt backend/
|
| 8 |
COPY backend/requirements.txt backend/
|
| 9 |
+
RUN pip install --no-cache-dir -r backend/requirements-docker.txt -r backend/requirements.txt
|
| 10 |
|
| 11 |
# Non-root user for security
|
| 12 |
RUN groupadd -r solarwine && useradd -r -g solarwine solarwine
|
backend/requirements-docker.txt
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Slim requirements for Docker backend (no torch/chronos/streamlit)
|
| 2 |
+
# These are the packages actually needed at runtime by the FastAPI API.
|
| 3 |
+
|
| 4 |
+
pandas>=2.0
|
| 5 |
+
numpy>=1.24
|
| 6 |
+
scikit-learn>=1.3
|
| 7 |
+
requests>=2.28
|
| 8 |
+
python-dotenv>=1.0
|
| 9 |
+
xgboost>=2.0
|
| 10 |
+
pvlib>=0.10.0
|
| 11 |
+
astral>=3.2
|
| 12 |
+
google-genai>=1.0
|