Shanks / Dockerfile
MandlaZwane's picture
Update Dockerfile
f49eec0 verified
raw
history blame contribute delete
714 Bytes
# Use a base image with CUDA support
FROM nvidia/cuda:11.7.0-cudnn8-devel-ubuntu20.04
# Create a new user and switch to it
RUN useradd -m -u 1000 user
USER user
# Set the PATH
ENV PATH="/home/user/.local/bin:$PATH"
# Set the working directory
WORKDIR /app
# Install the packaging and numpy modules
RUN pip install packaging numpy
# Copy the requirements file and install dependencies
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the rest of the application code
COPY --chown=user . /app
# Run the application
CMD ["uvicorn", "-w", "4", "-b", "0.0.0.0:8080", "app:app"]
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:8080", "app:app"]