SyedHutter commited on
Commit
1a50616
·
verified ·
1 Parent(s): 32d7156

Dockerfile Beta 2

Browse files
Files changed (1) hide show
  1. Dockerfile +1 -9
Dockerfile CHANGED
@@ -1,26 +1,18 @@
1
  FROM python:3.9
2
 
3
- # Set the working directory
4
  WORKDIR /code
5
 
6
- # Copy the requirements file and install dependencies
7
  COPY ./requirements.txt /code/requirements.txt
8
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
9
 
10
- # Create a user and set environment variables
11
  RUN useradd user
12
  USER user
13
  ENV HOME=/home/user \
14
  PATH=/home/user/.local/bin:$PATH
15
 
16
- # Set the working directory for the user
17
  WORKDIR $HOME/app
18
 
19
- # Copy the application code and the model folder
20
  COPY --chown=user . $HOME/app
21
  COPY --chown=user ./en_core_web_sm-3.8.0 $HOME/app/en_core_web_sm-3.8.0
22
- COPY --chown=user ./download_model.py $HOME/app/download_model.py
23
- RUN python download_model.py # Downloads during build
24
 
25
- # Set the command to run the application
26
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.9
2
 
 
3
  WORKDIR /code
4
 
 
5
  COPY ./requirements.txt /code/requirements.txt
6
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
7
 
 
8
  RUN useradd user
9
  USER user
10
  ENV HOME=/home/user \
11
  PATH=/home/user/.local/bin:$PATH
12
 
 
13
  WORKDIR $HOME/app
14
 
 
15
  COPY --chown=user . $HOME/app
16
  COPY --chown=user ./en_core_web_sm-3.8.0 $HOME/app/en_core_web_sm-3.8.0
 
 
17
 
18
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]