forked from icewind1991/mx-puppet-steam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
52 lines (40 loc) · 1.21 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
FROM node:18-alpine AS builder
WORKDIR /opt/mx-puppet-steam
RUN apk add --no-cache \
python3 \
g++ \
build-base \
cairo-dev \
jpeg-dev \
pango-dev \
musl-dev \
giflib-dev \
pixman-dev \
pangomm-dev \
libjpeg-turbo-dev \
freetype-dev
# run build process as user in case of npm pre hooks
# pre hooks are not executed while running as root
COPY package.json package-lock.json ./
COPY patches ./patches
RUN chown -R node:node /opt/mx-puppet-steam
USER node
RUN npm ci
COPY tsconfig.json ./
COPY src/ ./src/
RUN npm run build
RUN rm -r node_modules/typescript
FROM node:18-alpine
VOLUME /data
ENV CONFIG_PATH=/data/config.yaml \
REGISTRATION_PATH=/data/steam-registration.yaml
# su-exec is used by docker-run.sh to drop privileges
RUN apk add --no-cache su-exec pixman cairo pango giflib libjpeg
WORKDIR /opt/mx-puppet-steam
COPY docker-run.sh ./
COPY --from=builder /opt/mx-puppet-steam/node_modules/ ./node_modules/
COPY --from=builder /opt/mx-puppet-steam/build/ ./build/
# change workdir to /data so relative paths in the config.yaml
# point to the persisten volume
WORKDIR /data
ENTRYPOINT ["/opt/mx-puppet-steam/docker-run.sh"]