ZeroTraceX commited on
Commit
3f76caf
·
verified ·
1 Parent(s): bd87b84

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -11
Dockerfile CHANGED
@@ -10,19 +10,18 @@ RUN apt-get update && apt-get install -y \
10
  # Create user and set up environment
11
  RUN useradd -m -u 1000 user
12
 
 
13
  RUN --mount=type=secret,id=Access_key,mode=0444,required=true \
14
- git clone $(cat /run/secrets/Access_key) /app
15
-
16
- # Set proper permissions for the application directories
17
- WORKDIR /app
18
- RUN chown -R user:user /app && \
19
- mkdir -p /app/temp && \
20
- mkdir -p /app/uploads && \
21
- chown -R user:user /app/temp && \
22
- chown -R user:user /app/uploads && \
23
  chmod -R 755 /app && \
24
  chmod -R 777 /app/temp && \
25
- chmod -R 777 /app/uploads
 
 
 
 
26
 
27
  # Switch to user for pip installations
28
  USER user
@@ -31,5 +30,8 @@ ENV PATH="/home/user/.local/bin:$PATH"
31
  # Install Python dependencies
32
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
33
 
 
 
 
34
  # Start the application
35
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]
 
10
  # Create user and set up environment
11
  RUN useradd -m -u 1000 user
12
 
13
+ # Clone the repository and set up directories
14
  RUN --mount=type=secret,id=Access_key,mode=0444,required=true \
15
+ git clone $(cat /run/secrets/Access_key) /app && \
16
+ mkdir -p /app/temp /app/uploads /app/files && \
17
+ chown -R user:user /app && \
 
 
 
 
 
 
18
  chmod -R 755 /app && \
19
  chmod -R 777 /app/temp && \
20
+ chmod -R 777 /app/uploads && \
21
+ chmod -R 777 /app/files
22
+
23
+ # Set working directory
24
+ WORKDIR /app
25
 
26
  # Switch to user for pip installations
27
  USER user
 
30
  # Install Python dependencies
31
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
32
 
33
+ # Expose port 7860
34
+ EXPOSE 7860
35
+
36
  # Start the application
37
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]