fashion-tag-generator / Dockerfile
lele-cecere's picture
changed docker image
9cee656
raw
history blame contribute delete
No virus
1 kB
FROM docker.io/nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04@sha256:8f9dd0d09d3ad3900357a1cf7f887888b5b74056636cd6ef03c160c3cd4b1d95
RUN apt-get update && apt-get install -y python3 python3-pip
WORKDIR /code
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Install PyTorch for GPU check
RUN pip install --no-cache-dir torch torchvision
# Add and run the GPU check script
COPY gpu_check.py /code/gpu_check.py
RUN python3 /code/gpu_check.py
# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user
# Switch to the "user" user
USER user
# Set home to the user's home directory
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Set the working directory to the user's home directory
WORKDIR $HOME/app
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=user . $HOME/app
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]