forked from kmswlee/sketch-to-art
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile-gpu
47 lines (37 loc) · 1.3 KB
/
Dockerfile-gpu
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
37
38
39
40
41
42
43
44
45
46
47
FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
CMD ["/bin/bash"]
# Configure packages needed
RUN apt-get update \
# Install python3-pip
&& apt-get -y install python3-pip \
&& apt update \
&& apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates \
&& curl -sL https://deb.nodesource.com/setup_10.x | bash \
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update && apt-get -y install yarn
RUN mkdir -p /usr/src/app
# Install node packages
ADD ./package.json ./yarn.* /tmp/
RUN cd /tmp && yarn
RUN cd /usr/src/app && ln -s /tmp/node_modules
# Install Python dependencies
ADD server/requirements.txt /tmp/
RUN pip3 --no-cache-dir install -r /tmp/requirements.txt
# Download models
RUN apt-get -y install wget unzip
ADD server/models/download_models.sh /tmp/models/
RUN cd /tmp/models && ./download_models.sh
# Add project and change directory
RUN pip3 install requests
ADD . /usr/src/app/
WORKDIR /usr/src/app
RUN cd server/models \
&& ln -s /tmp/models/wct \
&& ln -s /tmp/models/pix2pix
EXPOSE 8080
CMD ["bash", "run.sh"]