Multimedia_FAPI / Dockerfile
Surrendra's picture
Calling gunicorn via python
7fbaa19 verified
Raw History Blame
1.24 kB
# For more information, please refer to https://aka.ms/vscode-docker-python
FROM python:3-slim
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 /app
# Install pip requirements
RUN pip install --upgrade pip && pip install numpy
RUN apt-get update && apt-get install -y ffmpeg
COPY requirements.txt ./app/requirements.txt
#COPY summarize_mp4_video.py /app/app.py
RUN pip install --no-cache-dir --upgrade -r ./app/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 adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
USER appuser
RUN pip install 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"]