forked from takashiishida/paper2slides
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.api
More file actions
41 lines (32 loc) · 1.13 KB
/
Copy pathDockerfile.api
File metadata and controls
41 lines (32 loc) · 1.13 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
FROM python:3.10-slim
# Install system dependencies for LaTeX compilation and PDF processing
RUN apt-get update && apt-get install -y \
texlive-latex-base \
texlive-latex-recommended \
texlive-latex-extra \
texlive-fonts-recommended \
texlive-fonts-extra \
texlive-lang-all \
texlive-science \
latexmk \
chktex \
poppler-utils \
&& rm -rf /var/lib/apt/lists/*
# Install uv for faster and safer Python package management
RUN pip install uv
# Set working directory
WORKDIR /app
# Copy project files and install Python dependencies using uv
COPY pyproject.toml uv.lock ./
RUN uv sync
# Copy the rest of the application code
COPY . /app
# Create necessary directories
RUN mkdir -p /app/api_workspaces /app/cache /app/source
# Expose port 8000 (map to different host port via Docker: -p HOST_PORT:8000)
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import requests; requests.get('http://localhost:8000/health')"
# Run the API using uvicorn on port 8000
CMD ["uv", "run", "uvicorn", "api:app", "--host", "0.0.0.0", "--port", "8000"]