AurelioAguirre commited on
Commit
9eee3d5
·
1 Parent(s): 47031d7

Fixing dockerfile v1

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