-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (35 loc) · 1.1 KB
/
Dockerfile
File metadata and controls
47 lines (35 loc) · 1.1 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
43
44
45
46
47
# Stage 1: Build stage
FROM python:3.13-slim AS builder
# Set work directory
WORKDIR /app
# Set env variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Copy dependencies and requirements files first
COPY pyproject.toml .
COPY uv.lock .
# Install system dependencies required by spaCy and build tools
RUN apt-get update && apt-get install --no-install-recommends -y \
wget build-essential python3-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
RUN pip install --upgrade pip \
&& pip install uv \
&& touch README.md \
&& uv pip install -v --system --no-cache-dir .
# Stage 2: Final stage
FROM python:3.13-slim
# Set work directory
WORKDIR /app
# Set env variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Copy application from builder stage
COPY --from=builder /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
# Copy application code
COPY . .
# Expose the default port
EXPOSE 10000
# Run the application
CMD ["python", "__main__.py", "--host", "0.0.0.0", "--port", "10000"]