Spaces:
Sleeping
Sleeping
fix
Browse files- Dockerfile +17 -9
Dockerfile
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
# For more information, please refer to https://aka.ms/vscode-docker-python
|
| 2 |
-
FROM python:
|
| 3 |
|
| 4 |
EXPOSE 8000
|
| 5 |
|
|
@@ -8,25 +8,33 @@ ENV PYTHONDONTWRITEBYTECODE=1
|
|
| 8 |
|
| 9 |
# Turns off buffering for easier container logging
|
| 10 |
ENV PYTHONUNBUFFERED=1
|
| 11 |
-
WORKDIR /
|
| 12 |
# Install pip requirements
|
| 13 |
RUN pip install --upgrade pip && pip install numpy
|
| 14 |
RUN apt-get update && apt-get install -y ffmpeg
|
| 15 |
-
COPY requirements.txt ./
|
| 16 |
#COPY summarize_mp4_video.py /app/app.py
|
| 17 |
-
RUN pip install --no-cache-dir --upgrade -r ./
|
| 18 |
|
| 19 |
|
| 20 |
# COPY . /app
|
| 21 |
|
| 22 |
# Creates a non-root user with an explicit UID and adds permission to access the /app folder
|
| 23 |
# For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers
|
| 24 |
-
RUN
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug
|
| 28 |
#CMD ["/home/appuser/.local/bin/gunicorn", "--bind", "0.0.0.0:8000", "-k", "uvicorn.workers.UvicornWorker", "setup:app"]
|
| 29 |
#CMD ["python", "-m", "gunicorn", "-w", "2", "-k", "uvicorn.workers.UvicornWorker", "setup:app"]
|
| 30 |
-
RUN chmod +x /home/appuser/.local/bin/gunicorn
|
| 31 |
#CMD ["/home/appuser/.local/bin/gunicorn", "-w", "2", "-k", "uvicorn.workers.UvicornWorker", "app:app"]
|
| 32 |
-
CMD ["python", "-m", "gunicorn", "--bind", "0.0.0.0:8000", "-k", "uvicorn.workers.UvicornWorker", "app:app"]
|
|
|
|
| 1 |
# For more information, please refer to https://aka.ms/vscode-docker-python
|
| 2 |
+
FROM python:9
|
| 3 |
|
| 4 |
EXPOSE 8000
|
| 5 |
|
|
|
|
| 8 |
|
| 9 |
# Turns off buffering for easier container logging
|
| 10 |
ENV PYTHONUNBUFFERED=1
|
| 11 |
+
WORKDIR /code
|
| 12 |
# Install pip requirements
|
| 13 |
RUN pip install --upgrade pip && pip install numpy
|
| 14 |
RUN apt-get update && apt-get install -y ffmpeg
|
| 15 |
+
COPY requirements.txt ./code/requirements.txt
|
| 16 |
#COPY summarize_mp4_video.py /app/app.py
|
| 17 |
+
RUN pip install --no-cache-dir --upgrade -r ./code/requirements.txt
|
| 18 |
|
| 19 |
|
| 20 |
# COPY . /app
|
| 21 |
|
| 22 |
# Creates a non-root user with an explicit UID and adds permission to access the /app folder
|
| 23 |
# For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers
|
| 24 |
+
RUN useradd user
|
| 25 |
+
#RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
|
| 26 |
+
USER user
|
| 27 |
+
ENV HOME=/home/user \
|
| 28 |
+
PATH=/home/user/.local/bin:$PATH
|
| 29 |
+
WORKDIR $HOME/app
|
| 30 |
+
COPY --chown=user . $HOME/app
|
| 31 |
+
## Start the FASTAPI App on port 7860
|
| 32 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 33 |
+
|
| 34 |
+
#RUN pip install --no-cache-dir gunicorn
|
| 35 |
# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug
|
| 36 |
#CMD ["/home/appuser/.local/bin/gunicorn", "--bind", "0.0.0.0:8000", "-k", "uvicorn.workers.UvicornWorker", "setup:app"]
|
| 37 |
#CMD ["python", "-m", "gunicorn", "-w", "2", "-k", "uvicorn.workers.UvicornWorker", "setup:app"]
|
| 38 |
+
#RUN chmod +x /home/appuser/.local/bin/gunicorn
|
| 39 |
#CMD ["/home/appuser/.local/bin/gunicorn", "-w", "2", "-k", "uvicorn.workers.UvicornWorker", "app:app"]
|
| 40 |
+
#CMD ["python", "-m", "gunicorn", "--bind", "0.0.0.0:8000", "-k", "uvicorn.workers.UvicornWorker", "app:app"]
|