-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (49 loc) · 1.87 KB
/
Dockerfile
File metadata and controls
59 lines (49 loc) · 1.87 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
# Make a run environment with nodejs and wine
FROM tianon/wine:5
RUN apt-get update -yq \
&& apt-get install curl wget gnupg -yq \
&& curl -sL https://deb.nodesource.com/setup_16.x | bash \
&& apt-get install nodejs make g++ -yq \
&& apt-get install -qq build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
ARG BUILDDIR="/tmp/build"
ARG PYTHON_VER="3.6.8"
WORKDIR ${BUILDDIR}
# install python 3.5.6 which is needed to build node-canvas
# node-canvas has to be rebuilt for docker based os
RUN apt-get update -qq && \
apt-get upgrade -y > /dev/null 2>&1 && \
apt-get install wget gcc make zlib1g-dev -y -qq > /dev/null 2>&1 && \
wget --quiet https://www.python.org/ftp/python/${PYTHON_VER}/Python-${PYTHON_VER}.tgz > /dev/null 2>&1 && \
tar zxf Python-${PYTHON_VER}.tgz && \
cd Python-${PYTHON_VER} && \
./configure > /dev/null 2>&1 && \
make > /dev/null 2>&1 && \
make install > /dev/null 2>&1 && \
rm -rf ${BUILDDIR}
# add fonts for generating images
COPY ./build/static/Roboto-Regular.ttf ./
COPY ./build/static/Roboto-Bold.ttf ./
COPY ./build/static/exocetblizzardot-medium.otf ./
RUN mkdir -p /usr/share/fonts/truetype/
RUN install -m644 Roboto-Regular.ttf /usr/share/fonts/truetype/
RUN install -m644 Roboto-Bold.ttf /usr/share/fonts/truetype/
RUN install -m644 exocetblizzardot-medium.otf /usr/share/fonts/truetype/
RUN rm ./Roboto-Regular.ttf
RUN rm ./Roboto-Bold.ttf
RUN rm ./exocetblizzardot-medium.otf
RUN fc-cache -f
ENV WINEARCH=win32
ENV WINEDEBUG=-all
ENV NODE_ENV=production
VOLUME [ "/app/game" ]
VOLUME [ "/app/cache" ]
EXPOSE ${PORT}
WORKDIR /app
COPY /bin/d2-map.exe /app/bin/d2-map.exe
COPY /bin/d2.install.reg /app/
COPY package.json /app/
RUN npm install canvas --build-from-source
RUN npm install --production
COPY /build/ /app/build/
# COPY game /app/game/
CMD ["node", "build/server/server.js"]