-
Notifications
You must be signed in to change notification settings - Fork 424
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (19 loc) · 751 Bytes
/
Copy pathDockerfile
File metadata and controls
27 lines (19 loc) · 751 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
FROM python:3.12-slim
WORKDIR /app
# Install system dependencies required by some Python packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends libmagic1 \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY backend/requirements.txt ./requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy backend source
COPY backend/ ./backend/
# Copy frontend
COPY frontend/ ./frontend/
# Expose port
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/healthz/live', timeout=3).read()" || exit 1
# Run
CMD ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "8000"]