mjuvilla commited on
Commit
f82c7b7
·
1 Parent(s): 7a3ec05
Files changed (1) hide show
  1. Dockerfile +18 -13
Dockerfile CHANGED
@@ -1,10 +1,26 @@
1
  FROM python:3.12-slim
2
 
3
- WORKDIR /app
4
-
5
  RUN apt-get update && \
6
  apt-get install -y libgomp1 openjdk-17-jre-headless wget unzip libgoogle-perftools-dev libsparsehash-dev git cmake build-essential
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  # download and compile fast align
9
  RUN git clone https://github.com/clab/fast_align.git fast_align_src && \
10
  cd fast_align_src && \
@@ -24,15 +40,4 @@ RUN unzip okapi-apps_gtk2-linux-x86_64_1.47.0.zip -d okapi-apps_gtk2-linux-x86_6
24
  RUN pip install -r requirements.txt
25
  RUN python -m spacy download xx_ent_wiki_sm
26
 
27
- RUN useradd -m appuser
28
- USER appuser
29
-
30
- RUN chown -R appuser:appuser /app
31
-
32
- COPY fast_align_config ./fast_align_config
33
- COPY src ./src
34
- COPY gradio_app.py .
35
- COPY requirements.txt .
36
- run mkdir /app/tmp
37
-
38
  CMD ["python", "gradio_app.py"]
 
1
  FROM python:3.12-slim
2
 
 
 
3
  RUN apt-get update && \
4
  apt-get install -y libgomp1 openjdk-17-jre-headless wget unzip libgoogle-perftools-dev libsparsehash-dev git cmake build-essential
5
 
6
+ # Set up a new user named "user" with user ID 1000
7
+ RUN useradd -m -u 1000 user
8
+
9
+ # Switch to the "user" user
10
+ USER user
11
+
12
+ # Set home to the user's home directory
13
+ ENV HOME=/home/user \
14
+ PATH=/home/user/.local/bin:$PATH
15
+
16
+ # Set the working directory to the user's home directory
17
+ WORKDIR $HOME/app
18
+
19
+ COPY --chown=user fast_align_config ./fast_align_config
20
+ COPY --chown=user src ./src
21
+ COPY --chown=user gradio_app.py .
22
+ COPY --chown=user requirements.txt .
23
+
24
  # download and compile fast align
25
  RUN git clone https://github.com/clab/fast_align.git fast_align_src && \
26
  cd fast_align_src && \
 
40
  RUN pip install -r requirements.txt
41
  RUN python -m spacy download xx_ent_wiki_sm
42
 
 
 
 
 
 
 
 
 
 
 
 
43
  CMD ["python", "gradio_app.py"]