File size: 782 Bytes
d73dbf8
35fb47d
 
d73dbf8
35fb47d
 
 
 
 
 
 
 
 
d73dbf8
35fb47d
d73dbf8
a7038f8
d73dbf8
 
 
 
 
 
915f45e
 
35fb47d
d73dbf8
 
 
e034113
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
FROM python:3.11-slim

# Create a non-root user
RUN useradd -m -u 1000 user

# Install system dependencies as root
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    libgl1-mesa-glx \
    libglib2.0-0 && \
    rm -rf /var/lib/apt/lists/*

# Switch to the non-root user
USER user

ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app

COPY --chown=user ./pyproject.toml ./poetry.lock ./
COPY --chown=user ./app /app
COPY --chown=user ./embed_model_weights.pth ./
COPY --chown=user ./requirements.txt ./

# Copy the packages.txt file into the Docker image
COPY --chown=user ./packages.txt ./

# Install Python dependencies using pip
RUN pip install --no-cache-dir -r requirements.txt

ENTRYPOINT ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]