vkrishnan569 commited on
Commit
6e4371a
1 Parent(s): 630946f

server deployment

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -3
Dockerfile CHANGED
@@ -1,13 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 . .
10
 
11
- RUN mkdir -p /path_to_cache_directory
12
 
13
- CMD ["uvicorn","main:model","--host", "0.0.0.0", "--port", "80"]
 
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 . .
10
+
11
+ # RUN mkdir -p /path_to_cache_directory
12
+
13
+ # CMD ["uvicorn","main:model","--host", "0.0.0.0", "--port", "80"]
14
+
15
  FROM python:3.9
16
 
17
+ RUN useradd -m -u 1000 user
18
+ USER user
19
+
20
  WORKDIR /code
21
 
22
  COPY ./requirements.txt /code/requirements.txt
23
 
24
+ RUN chown -R user:user /code
25
+
26
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
27
 
28
+ COPY --chown=user:user . /path_to_cache_directory
29
 
 
30
 
31
+ CMD ["gunicorn", "-b", "0.0.0.0:7860", "main:app"]