Multimedia_FAPI / Dockerfile
Surrendra's picture
fix
5a3cd56 verified
Raw History Blame Contribute Delete
1.79 kB
# For more information, please refer to https://aka.ms/vscode-docker-python
FROM python:3.13
EXPOSE 8000
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1
WORKDIR /code
# Install pip requirements
RUN pip install --upgrade pip && pip install numpy
RUN apt-get update && apt-get install -y ffmpeg
RUN pip install --no-cache-dir imageio_ffmpeg
COPY requirements.txt ./code/requirements.txt
#COPY summarize_mp4_video.py /app/app.py
RUN pip install --no-cache-dir --upgrade -r ./code/requirements.txt
# COPY . /app
# Creates a non-root user with an explicit UID and adds permission to access the /app folder
# For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers
RUN useradd user
#RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
COPY --chown=user . $HOME/app
## Start the FASTAPI App on port 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
#RUN pip install --no-cache-dir gunicorn
# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug
#CMD ["/home/appuser/.local/bin/gunicorn", "--bind", "0.0.0.0:8000", "-k", "uvicorn.workers.UvicornWorker", "setup:app"]
#CMD ["python", "-m", "gunicorn", "-w", "2", "-k", "uvicorn.workers.UvicornWorker", "setup:app"]
#RUN chmod +x /home/appuser/.local/bin/gunicorn
#CMD ["/home/appuser/.local/bin/gunicorn", "-w", "2", "-k", "uvicorn.workers.UvicornWorker", "app:app"]
#CMD ["python", "-m", "gunicorn", "--bind", "0.0.0.0:8000", "-k", "uvicorn.workers.UvicornWorker", "app:app"]