Mbonea commited on
Commit
b2868c4
·
1 Parent(s): 73df4f2
Files changed (1) hide show
  1. Dockerfile +2 -14
Dockerfile CHANGED
@@ -1,15 +1,7 @@
1
  # Builder stage
2
  FROM python:latest as builder
3
 
4
- # Create a non-root user and group
5
- RUN groupadd -r appuser && useradd -r -g appuser appuser
6
-
7
- # Set the working directory and grant permissions to the non-root user
8
  WORKDIR /srv
9
- RUN chown -R appuser:appuser /srv
10
-
11
- # Create the Downloads directory with the correct permissions
12
- RUN mkdir -p /srv/App/Downloads && chown -R appuser:appuser /srv/App/Downloads
13
 
14
  # Install dependencies and Python packages
15
  RUN apt-get update && apt-get install -y git ffmpeg aria2 \
@@ -18,15 +10,11 @@ RUN apt-get update && apt-get install -y git ffmpeg aria2 \
18
  COPY requirements.txt .
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
- # Copy the application code and grant permissions to the non-root user
22
  COPY . /srv
23
- RUN chown -R appuser:appuser /srv
24
-
25
- # Switch to the non-root user
26
- USER appuser
27
 
28
  # Command to run the application
29
- CMD uvicorn App.app:app --host 0.0.0.0 --port 7860 & celery -A App.Worker.celery worker -c 8 --loglevel=info
30
 
31
  # Expose the server port
32
  EXPOSE 7860
 
1
  # Builder stage
2
  FROM python:latest as builder
3
 
 
 
 
 
4
  WORKDIR /srv
 
 
 
 
5
 
6
  # Install dependencies and Python packages
7
  RUN apt-get update && apt-get install -y git ffmpeg aria2 \
 
10
  COPY requirements.txt .
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
+ # Copy the application code
14
  COPY . /srv
 
 
 
 
15
 
16
  # Command to run the application
17
+ CMD uvicorn App.app:app --host 0.0.0.0 --port 7860 & celery -A App.Worker.celery worker -c 8 --logevity=info
18
 
19
  # Expose the server port
20
  EXPOSE 7860