-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.template
More file actions
31 lines (24 loc) · 1.09 KB
/
Dockerfile.template
File metadata and controls
31 lines (24 loc) · 1.09 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
ARG NODEJS_VERSION="16.19.1"
FROM balenalib/%%BALENA_MACHINE_NAME%%-debian-node:${NODEJS_VERSION}-bullseye-run
# use `install_packages` if you need to install dependencies,
# for instance if you need git, just uncomment the line below.
# RUN install_packages git
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
rsync \
dbus && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Defines our working directory in container
WORKDIR /usr/src/app
# Copies the package.json first for better cache on later pushes
COPY package.json package.json
# This install npm dependencies on the balena build server,
# making sure to clean up the artifacts it creates in order to reduce the image size.
RUN JOBS=MAX npm install --production --unsafe-perm && npm cache verify && rm -rf /tmp/*
# Enable udevd so that plugged dynamic hardware devices show up in our container.
ENV UDEV=1
# This will copy all files in our root to the working directory in the container
COPY . ./
# server.js will run when container starts up on the device
#CMD ["npm", "start"]
CMD ["bash", "/usr/src/app/init"]