custom-api / Dockerfile
DataChem's picture
Create Dockerfile
a1dd175 verified
raw
history blame
432 Bytes
# Use a lightweight Python image
FROM python:3.9
# Create a non-root user
RUN useradd -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# Set the working directory inside the container
WORKDIR /app
# Copy the dependencies and install them
COPY --chown=user . /app
RUN pip install --no-cache-dir -r requirements.txt
# Run the FastAPI app with Uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]