wesslen commited on
Commit
9773321
1 Parent(s): 556476f

update Dockerfile for sqlite3, user

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -0
Dockerfile CHANGED
@@ -3,6 +3,8 @@ FROM python:3.9
3
  #COPY requirements.txt /app/
4
  WORKDIR /app
5
 
 
 
6
  RUN --mount=type=secret,id=LICENSE_KEY,mode=0444,required=true \
7
  pip install --upgrade pip \
8
  && pip install prodigy -f https://$(cat /run/secrets/LICENSE_KEY)@download.prodi.gy
@@ -16,6 +18,20 @@ RUN python -m spacy download en_core_web_sm
16
  COPY prodigy.json .
17
  COPY data ./data/
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  ENV PRODIGY_HOME /app
20
  ENV PRODIGY_LOGGING "verbose"
21
  ENV PRODIGY_ALLOWED_SESSIONS "user1,user2"
 
3
  #COPY requirements.txt /app/
4
  WORKDIR /app
5
 
6
+ RUN sudo apt-get install -y sqlite3 libsqlite3-dev
7
+
8
  RUN --mount=type=secret,id=LICENSE_KEY,mode=0444,required=true \
9
  pip install --upgrade pip \
10
  && pip install prodigy -f https://$(cat /run/secrets/LICENSE_KEY)@download.prodi.gy
 
18
  COPY prodigy.json .
19
  COPY data ./data/
20
 
21
+ # Set up a new user named "user" with user ID 1000
22
+ RUN useradd -m -u 1000 user
23
+ # Switch to the "user" user
24
+ USER user
25
+ # Set home to the user's home directory
26
+ ENV HOME=/home/user \
27
+ PATH=/home/user/.local/bin:$PATH
28
+
29
+ # Set the working directory to the user's home directory
30
+ WORKDIR $HOME/app
31
+
32
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
33
+ COPY --chown=user . $HOME/app
34
+
35
  ENV PRODIGY_HOME /app
36
  ENV PRODIGY_LOGGING "verbose"
37
  ENV PRODIGY_ALLOWED_SESSIONS "user1,user2"