forked from singnet/style-transfer-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (30 loc) · 1.38 KB
/
Dockerfile
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
34
35
36
## Create container using nvidia-docker and add shared memory size argument
FROM nightseas/cuda-torch:latest
ARG git_owner
ARG git_repo
ARG git_branch
ENV SINGNET_REPOS=/opt/singnet
ENV PROJECT_ROOT=${SINGNET_REPOS}/${git_repo}
ENV SERVICE_DIR=${PROJECT_ROOT}/service
## Installing common dependencies and python3-pip
RUN apt-get update && \
apt-get install -y sudo python3-pip && \
pip3 install --upgrade pip
# Installing snet-daemon + dependencies
RUN SNETD_VERSION=`curl -s https://api.github.com/repos/singnet/snet-daemon/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")' || echo "v3.1.0"` && \
echo 'version' $SNETD_VERSION && \
wget https://github.com/singnet/snet-daemon/releases/download/${SNETD_VERSION}/snet-daemon-${SNETD_VERSION}-linux-amd64.tar.gz && \
tar -xvf snet-daemon-${SNETD_VERSION}-linux-amd64.tar.gz && \
sudo mv snet-daemon-${SNETD_VERSION}-linux-amd64/snetd /usr/bin/snetd
# Cloning service repository and downloading models
RUN mkdir -p ${SINGNET_REPOS} && \
cd ${SINGNET_REPOS} &&\
git clone -b ${git_branch} https://github.com/${git_owner}/${git_repo}.git &&\
cd ${SERVICE_DIR} &&\
cd original-lua-code &&\
. ./models/download_models.sh
# Installing projects's original dependencies and building protobuf messages
RUN cd ${PROJECT_ROOT} &&\
pip3 install -r requirements.txt &&\
sh buildproto.sh
WORKDIR ${PROJECT_ROOT}