Akane710 commited on
Commit
5b87288
·
verified ·
1 Parent(s): 74b0b87

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -10
Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
  ARG PYTHON_VERSION=3.12.1
2
  FROM python:${PYTHON_VERSION}-slim AS base
3
 
4
- # Install system dependencies
5
  RUN apt-get update && \
6
  apt-get install -y pipenv && \
7
  apt-get install -y \
@@ -15,30 +15,30 @@ RUN apt-get update && \
15
  ffmpeg && \
16
  rm -rf /var/lib/apt/lists/*
17
 
18
- # Set environment variables
19
  ENV PORT=7860
20
  ENV PIPENV_VENV_IN_PROJECT=1
21
 
22
- # Create a non-root user and group
23
  RUN groupadd -g 1000 appuser && \
24
  useradd -m -u 1000 -g appuser appuser
25
 
26
- # Set the working directory and adjust permissions
27
  WORKDIR /app
28
  RUN chown -R appuser:appuser /app
29
 
30
- # Switch to the non-root user
31
  USER appuser
32
 
33
- # Copy application code
34
  COPY --chown=appuser:appuser . .
35
 
36
- # Expose the application port
37
  EXPOSE 7860
38
 
39
- # Install Python dependencies
40
  RUN pipenv install --dev --ignore-pipfile && \
41
- pipenv run pip install cloudinary uvicorn fastapi git+http://github.com/Simatwa/ytube-api ffmpeg-python
 
42
 
43
- # Run the application
44
  CMD [ "pipenv", "run", "python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "8", "--timeout-keep-alive", "600" ]
 
1
  ARG PYTHON_VERSION=3.12.1
2
  FROM python:${PYTHON_VERSION}-slim AS base
3
 
4
+
5
  RUN apt-get update && \
6
  apt-get install -y pipenv && \
7
  apt-get install -y \
 
15
  ffmpeg && \
16
  rm -rf /var/lib/apt/lists/*
17
 
18
+
19
  ENV PORT=7860
20
  ENV PIPENV_VENV_IN_PROJECT=1
21
 
22
+
23
  RUN groupadd -g 1000 appuser && \
24
  useradd -m -u 1000 -g appuser appuser
25
 
26
+
27
  WORKDIR /app
28
  RUN chown -R appuser:appuser /app
29
 
30
+
31
  USER appuser
32
 
33
+
34
  COPY --chown=appuser:appuser . .
35
 
36
+
37
  EXPOSE 7860
38
 
39
+
40
  RUN pipenv install --dev --ignore-pipfile && \
41
+ pipenv run pip install cloudinary uvicorn fastapi git+http://github.com/Simatwa/ytube-api ffmpeg-python python-multipart
42
+
43
 
 
44
  CMD [ "pipenv", "run", "python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "8", "--timeout-keep-alive", "600" ]