-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (24 loc) · 711 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (24 loc) · 711 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
30
31
32
33
FROM python:3.10-slim
# System deps
RUN apt-get update && apt-get install -y \
libgl1 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install production dependencies only
COPY requirements-prod.txt .
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r requirements-prod.txt
# Copy source
COPY src/ src/
COPY apps/ apps/
COPY setup.py .
COPY openapi.yaml .
# Set Python path
ENV PYTHONPATH=/app/src
ENV REQUIREMENTS_FILE=requirements-prod.txt
# Install package
RUN pip install -e .
# Download model during build
RUN python -m solar_fault_detector.utils.download_model
EXPOSE 5000
CMD ["uvicorn", "apps.api.fastapi_app:app", "--host", "0.0.0.0", "--port", "5000"]