forked from allenai/pdffigures2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (30 loc) · 1.01 KB
/
Dockerfile
File metadata and controls
42 lines (30 loc) · 1.01 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
42
FROM python:3.10-slim
# Install OpenJDK 17 and other required dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
openjdk-17-jre-headless \
poppler-utils \
curl \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
# Install Poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
# Add Poetry to PATH
ENV PATH="/root/.local/bin:$PATH"
# Disable Poetry's virtual environments (optional)
ENV POETRY_VIRTUALENVS_CREATE=false
# Copy pyproject.toml and poetry.lock
COPY pyproject.toml poetry.lock ./
# Install Python dependencies
RUN poetry install --no-interaction --no-ansi
# Copy the FastAPI application code
COPY app/ .
# Copy the built JAR file into the container
COPY pdffigures2.jar /app/pdffigures2.jar
# Create necessary directories
RUN mkdir -p /app/logs /app/uploads /app/data
# Expose port 8000 for FastAPI
EXPOSE 8000
# Set the entry point to run the FastAPI app
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]