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

Trying Python 3.9, again v4

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -25
Dockerfile CHANGED
@@ -1,35 +1,23 @@
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
- COPY --chown=user main $HOME/app/main
30
 
31
- # Make sure port matches the one in your code
32
  EXPOSE 7680
33
 
34
- # Use uvicorn directly with specific settings
35
  CMD ["python", "-m", "main.app"]
 
 
 
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"]