Empereur-Pirate commited on
Commit
7e8c80c
·
verified ·
1 Parent(s): 409e83e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -11
Dockerfile CHANGED
@@ -1,15 +1,22 @@
1
  FROM python:3.9
2
 
3
- WORKDIR /code
4
-
5
- COPY ./requirements.txt /code/requirements.txt
 
6
 
 
 
7
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
 
9
- COPY static /app/static
 
10
 
11
- ENV UVICORN_HOST=0.0.0.0
12
- ENV UVICORN_PORT=7860
 
 
 
13
 
14
  # Set up a new user named "user" with user ID 1000
15
  RUN useradd -m -u 1000 user
@@ -27,9 +34,4 @@ WORKDIR $HOME/app
27
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
28
  COPY --chown=user . $HOME/app
29
 
30
- RUN pip install --upgrade bitsandbytes
31
- RUN rm -rf /usr/local/lib/python3.9/site-packages/bitsandbytes && \
32
- pip install --no-cache-dir --force-reinstall --upgrade bitsandbytes
33
- RUN pip install accelerate
34
-
35
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.9
2
 
3
+ # Install dependencies for building SentencePiece
4
+ RUN apt-get update && \
5
+ apt-get install -y protobuf-compiler libprotobuf-dev cmake zlib1g-dev git wget && \
6
+ rm -rf /var/lib/apt/lists/*
7
 
8
+ WORKDIR /code
9
+ COPY requirements.txt /code/requirements.txt
10
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
11
 
12
+ # Copy only the source code after installing the dependencies
13
+ COPY . /code
14
 
15
+ # Upgrade bitsandbytes
16
+ RUN pip install --no-cache-dir --force-reinstall --upgrade bitsandbytes
17
+
18
+ # Install accelerate
19
+ RUN pip install accelerate
20
 
21
  # Set up a new user named "user" with user ID 1000
22
  RUN useradd -m -u 1000 user
 
34
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
35
  COPY --chown=user . $HOME/app
36
 
 
 
 
 
 
37
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]