-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathDockerfile
77 lines (61 loc) · 1.71 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
68
69
70
71
72
73
74
75
76
77
FROM node:20-bullseye-slim as build
WORKDIR /bonob
COPY .git ./.git
COPY src ./src
COPY docs ./docs
COPY typings ./typings
COPY web ./web
COPY tests ./tests
COPY jest.config.js .
COPY register.js .
COPY .npmrc .
COPY tsconfig.json .
COPY package.json .
COPY package-lock.json .
ENV JEST_TIMEOUT=60000
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get -y upgrade && \
apt-get -y install --no-install-recommends \
libvips-dev \
python3 \
make \
git \
g++ && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
npm install && \
npm test && \
npm run gitinfo && \
npm run build && \
rm -Rf node_modules && \
NODE_ENV=production npm install --omit=dev
FROM node:20-bullseye-slim
LABEL maintainer="simojenki" \
org.opencontainers.image.source="https://github.com/simojenki/bonob" \
org.opencontainers.image.description="bonob SONOS SMAPI implementation" \
org.opencontainers.image.licenses="GPLv3"
ENV BNB_PORT=4534
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=UTC
EXPOSE $BNB_PORT
WORKDIR /bonob
COPY package.json .
COPY package-lock.json .
COPY --from=build /bonob/build/src ./src
COPY --from=build /bonob/node_modules ./node_modules
COPY --from=build /bonob/.gitinfo ./
COPY web ./web
COPY src/Sonoswsdl-1.19.4-20190411.142401-3.wsdl ./src/Sonoswsdl-1.19.4-20190411.142401-3.wsdl
RUN apt-get update && \
apt-get -y upgrade && \
apt-get -y install --no-install-recommends \
libvips \
tzdata \
wget && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
USER nobody
WORKDIR /bonob/src
HEALTHCHECK CMD wget -O- http://localhost:${BNB_PORT}/about || exit 1
CMD ["node", "app.js"]