File size: 901 Bytes
12d7151
c851c58
d5aa806
 
c851c58
d5aa806
 
 
 
 
 
 
1c6540f
 
 
 
 
d5aa806
1c6540f
d5aa806
12d7151
 
 
 
 
 
c851c58
d5aa806
c851c58
 
1c6540f
c851c58
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 python@sha256:e2c7fb05741c735679b26eda7dd34575151079f8c615875fbefe401972b14d85 AS build

RUN useradd -m -u 1000 user
USER user

# Set home to the user's home directory
ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

# Set the working directory to the user's home directory
WORKDIR $HOME/app

# copy installation files
COPY --chown=user shimnet shimnet/
COPY --chown=user pyproject.toml ./
# install shimnet (cpu version + GUI)
RUN pip install --no-cache-dir .[cpu,gui] --extra-index-url https://download.pytorch.org/whl/cpu 

FROM build AS final

# copy dirs used at inference time
COPY --chown=user configs configs
COPY --chown=user shimnet shimnet
# copy files used at inference time
COPY --chown=user predict-gui.py .
COPY --chown=user download_files.py .

# download weights
RUN python download_files.py --overwrite

CMD [ "python", "./predict-gui.py", "--server_name", "0.0.0.0" ]