dillonlaird commited on
Commit
a3ebaa7
·
1 Parent(s): 9a242d9

make user to remove permissions issue

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -8
Dockerfile CHANGED
@@ -1,18 +1,24 @@
1
  FROM node:slim
2
- WORKDIR /app
3
-
4
- COPY . .
5
 
6
  # python setup
 
7
  RUN apt-get update && apt-get install -y python3 python3-pip python3-venv ffmpeg libsm6 libxext6 pkg-config libpixman-1-dev libcairo2-dev libpango1.0-dev libgif-dev
8
  RUN python3 -m venv .venv
9
- RUN /app/.venv/bin/pip3 install --no-cache --upgrade -r /app/requirements.txt
 
 
 
 
 
 
 
 
 
10
 
11
  # nextjs setup
12
- WORKDIR /app/instance-labeler
13
  RUN yarn install && yarn build
14
 
15
- RUN mkdir -p /app/data
16
- WORKDIR /app
17
 
18
- CMD ["/app/.venv/bin/python3", "main.py"]
 
1
  FROM node:slim
2
+ WORKDIR /code
 
 
3
 
4
  # python setup
5
+ COPY ./requirements.txt /code/requirements.txt
6
  RUN apt-get update && apt-get install -y python3 python3-pip python3-venv ffmpeg libsm6 libxext6 pkg-config libpixman-1-dev libcairo2-dev libpango1.0-dev libgif-dev
7
  RUN python3 -m venv .venv
8
+ RUN /code/.venv/bin/pip3 install --no-cache --upgrade -r /code/requirements.txt
9
+
10
+ RUN useradd -m -u 1001 user
11
+ USER user
12
+ ENV HOME=/home/user \
13
+ PATH=/home/user/.local/bin:$PATH
14
+
15
+ WORKDIR $HOME/app
16
+ COPY . .
17
+ COPY --chown=user . $HOME/app
18
 
19
  # nextjs setup
20
+ WORKDIR $HOME/app/instance-labeler
21
  RUN yarn install && yarn build
22
 
 
 
23
 
24
+ CMD ["/code/.venv/bin/python3", "main.py"]