forked from bitfocus/companion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
executable file
·46 lines (34 loc) · 964 Bytes
/
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
FROM node:14
# User variable, define where to store the application config
ENV COMPANION_CONFIG_BASEDIR=/config
WORKDIR /app
COPY . /app/
# Installation Prep
RUN apt-get update && apt-get install -y \
libusb-1.0-0-dev \
libudev-dev \
unzip \
cmake \
&& rm -rf /var/lib/apt/lists/*
# Install dependencies
RUN ./tools/yarn.sh
# Generate version number file
RUN yarn build:writefile
# strip back unnecessary dependencies
RUN yarn --frozen-lockfile --prod
# Delete the webui source
RUN mv webui/build webui-build \
&& rm -R webui \
&& mkdir webui \
&& mv webui-build webui/build
# TODO - module-local-dev dependencies
# cleanup up some stuff that shouldnt be preserved
RUN rm -R .git
# make the production image
FROM node:14-slim
WORKDIR /app
COPY --from=0 /app/ /app/
# Bind to 0.0.0.0, as access should be scoped down by how the port is exposed from docker
USER node
EXPOSE 8000
ENTRYPOINT ["./headless_ip.js", "0.0.0.0"]