AurelioAguirre commited on
Commit
2d1f077
·
1 Parent(s): 9174d0d

Trying Python 3.9, again v2

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -13
Dockerfile CHANGED
@@ -1,23 +1,34 @@
 
 
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 and clean cache
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
+ #Dockerfile for LLMServer
2
+
3
  FROM python:3.9
4
 
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ bash \
8
+ wget \
9
+ git \
10
+ git-lfs \
11
+ && rm -rf /var/lib/apt/lists/*
12
 
13
+ # Set up user properly
14
+ RUN useradd -m -u 1000 user
15
+ ENV HOME=/home/user \
16
+ PATH=/home/user/.local/bin:$PATH
17
 
18
+ # Set working directory in user's home
19
+ WORKDIR $HOME/app
20
 
21
+ # Copy requirements and install as user
22
+ COPY --chown=user requirements.txt .
23
+ USER user
24
+ RUN pip install --no-cache-dir --upgrade pip && \
25
+ pip install --no-cache-dir -r requirements.txt
26
 
27
+ # Copy application code
28
+ COPY --chown=user . $HOME/app
 
29
 
30
+ # Make sure port matches the one in your code
31
  EXPOSE 7680
32
 
33
+ # Use uvicorn directly with specific settings
34
  CMD ["python", "-m", "main.app"]