rajeshradhakrishnan commited on
Commit
cb2f8a8
1 Parent(s): fda8f66

English-Malayalam Translate v5

Browse files
Files changed (2) hide show
  1. Dockerfile +17 -3
  2. translate.py +0 -1
Dockerfile CHANGED
@@ -3,11 +3,25 @@
3
 
4
  FROM python:3.9
5
 
6
- WORKDIR /code
7
 
8
- COPY ./requirements.txt /code/requirements.txt
 
 
 
 
 
 
 
 
 
9
 
10
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
 
 
 
 
 
11
 
12
  COPY . .
13
 
 
3
 
4
  FROM python:3.9
5
 
 
6
 
7
+ RUN useradd -m -u 1000 user
8
+ USER user
9
+ # Set home to the user's home directory
10
+ ENV HOME=/home/user \
11
+ PATH=/home/user/.local/bin:$PATH
12
+ WORKDIR $HOME/app
13
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
14
+ COPY --chown=user . $HOME/app
15
+ ADD --chown=user ./.translate_cache $HOME/app/.translate_cache
16
+ RUN chown user:user -R $HOME/app
17
 
18
+ ARG TRANSFORMERS_CACHE=$HOME/app/.translate_cache
19
+
20
+ #WORKDIR /code
21
+
22
+ COPY ./requirements.txt $HOME/app/requirements.txt
23
+
24
+ RUN pip install --no-cache-dir --upgrade -r $HOME/app/requirements.txt
25
 
26
  COPY . .
27
 
translate.py CHANGED
@@ -17,7 +17,6 @@ api = Api(app)
17
 
18
  app.config['CORS_HEADERS'] = 'Content-Type'
19
 
20
-
21
  class Classifier():
22
 
23
  def __init__(self, data_en):
 
17
 
18
  app.config['CORS_HEADERS'] = 'Content-Type'
19
 
 
20
  class Classifier():
21
 
22
  def __init__(self, data_en):