pdf-text-api / Dockerfile
Rivalcoder's picture
Create Dockerfile
84feb9e verified
raw
history blame
467 Bytes
# Use Python base image
FROM python:3.9
# Create a user and set up environment
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# Set working directory
WORKDIR /app
# Install dependencies
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy source code
COPY --chown=user . /app
# Run the API server
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]