AurelioAguirre commited on
Commit
142c3be
·
1 Parent(s): 4bcb998

Running main app v21

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -14
Dockerfile CHANGED
@@ -1,23 +1,18 @@
1
  FROM python:3.9
2
 
3
- # Set working directory
4
- WORKDIR /app
5
-
6
- # Copy requirements first to leverage Docker cache
7
- COPY requirements.txt .
8
 
9
- # Install dependencies
10
- RUN pip install --no-cache-dir -r requirements.txt
11
 
12
- # Copy only what's needed
13
- COPY main/ ./main/
14
 
15
- # Set environment variables
16
- ENV PYTHONPATH=/app
17
- ENV PYTHONUNBUFFERED=1
18
 
19
- # Expose the port
20
- EXPOSE 7680
21
 
22
  # Use same command as working version
23
  CMD ["python", "-m", "main.app"]
 
1
  FROM python:3.9
2
 
3
+ RUN useradd -m -u 1000 user
4
+ USER user
5
+ ENV PATH="/home/user/.local/bin:$PATH"
 
 
6
 
7
+ WORKDIR /app
 
8
 
9
+ COPY --chown=user ./requirements.txt requirements.txt
10
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
11
 
12
+ COPY --chown=user . /app
13
+ COPY --chown=user main/ /app/main
 
14
 
15
+ EXPOSE 7860
 
16
 
17
  # Use same command as working version
18
  CMD ["python", "-m", "main.app"]