# FROM python:3.10-slim | |
# # Install g++ | |
# RUN apt-get update && apt-get install -y g++ | |
# # "Handling Permission dennied Error" | |
# # RUN useradd user | |
# # USER user | |
# # ENV HOME=/home/user \ | |
# # PATH=/home/user/.local/bin:$PATH | |
# # WORKDIR /app | |
# # COPY --chown=user ./ $HOME/app | |
# # For GPU support: | |
# RUN pip3 install --extra-index-url https://download.pytorch.org/whl/cu118 torch torchvision | |
# RUN pip install -r requirements.txt | |
# CMD fastapi run --reload --host=0.0.0.0 --port=7860 | |
FROM python:3.10-slim | |
# Install g++ | |
RUN apt-get update && apt-get install -y g++ | |
# "Handling Permission denied Error" | |
RUN useradd user | |
USER user | |
ENV HOME=/app \ | |
PATH=/app/.local/bin:$PATH | |
WORKDIR /app | |
# Copy requirements file | |
COPY requirements.txt . | |
# For GPU support: | |
RUN pip3 install --extra-index-url https://download.pytorch.org/whl/cu118 torch torchvision | |
RUN pip install -r requirements.txt | |
# Copy application code | |
COPY . . | |
CMD fastapi run --reload --host=0.0.0.0 --port=7860 |