This repository has been archived by the owner on Apr 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
67 lines (49 loc) · 1.57 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# syntax = docker/dockerfile:1.4.2-labs
FROM node:14.19-slim as sc2-gamedata
RUN <<EOF
set -eux
apt-get update && apt-get install -y git
EOF
RUN git clone --depth 1 https://github.com/SC2Mapster/SC2GameData.git /sc2-gamedata
FROM node:14.19-slim
RUN <<EOF
set -eux
apt-get update && apt-get install -y \
git \
python \
make \
build-essential \
libx11-xcb1 \
libxtst6 \
libxss1
rm -rf /var/lib/apt/lists/*
EOF
# We don't need the standalone Chromium
# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
# Install Google Chrome Stable and fonts
# Note: this installs the necessary libs to make the browser work with Puppeteer.
RUN apt-get update && apt-get install gnupg wget -y && \
wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
apt-get update && \
apt-get install google-chrome-stable -y --no-install-recommends && \
rm -rf /var/lib/apt/lists/*
RUN <<EOF
mkdir /app
chown node:node /app
EOF
ENV YARN_CACHE_FOLDER=/tmp/.yarn_cache
WORKDIR /app
COPY package.json yarn.lock ./
RUN --mount=type=cache,target=/tmp/.yarn_cache <<EOF
set -eux
yarn install --pure-lockfile --no-interactive
EOF
COPY . .
RUN <<EOF
set -eux
yarn run build
EOF
COPY --from=sc2-gamedata --chown=node:node /sc2-gamedata /app/sc2-gamedata
USER node:node
CMD ["node", "lib/src/start.js"]