File size: 856 Bytes
6723494
 
 
a3ebaa7
c758574
a3ebaa7
 
 
 
 
 
6723494
c1a5203
 
 
 
 
 
6723494
a3ebaa7
6723494
 
5a65991
 
c758574
 
 
 
 
 
 
c1a5203
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM node:slim

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

RUN useradd -m -u 1001 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/app
COPY --chown=user . $HOME/app

# python setup
COPY requirements.txt $HOME/app/requirements.txt
RUN python3 -m venv .venv
RUN $HOME/app/.venv/bin/pip3 install --no-cache --upgrade -r $HOME/app/requirements.txt


# nextjs setup
WORKDIR $HOME/app/instance-labeler
RUN yarn install && yarn build

WORKDIR $HOME/app

# need this because I cannot create user 1000 because it's
# already taken by node, and user 1001 does not seem to have
# permissions to write files
USER root
RUN chmod 777 $HOME/app
USER user

CMD ["/home/user/app/.venv/bin/python3", "main.py"]