-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
39 lines (27 loc) · 1008 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
FROM balena/open-balena-base:18.0.21 as base
RUN apt-get update && \
apt-get install -yq --no-install-recommends \
libdbus-glib-1-dev \
avahi-utils \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/app
# Copies the package.json first for better cache on later pushes
COPY package.json package-lock.json /usr/src/app/
# Install the publisher
RUN JOBS=MAX npm ci --unsafe-perm --production && npm cache clean --force && rm -rf /tmp/*
# Copy and enable the service
COPY config/services /etc/systemd/system
RUN systemctl enable balena-mdns-publisher.service
# Build service
FROM base as build
RUN JOBS=MAX npm ci
COPY . /usr/src/app/
RUN JOBS=MAX npm run build
# Final image
FROM base
# Copy built code
COPY --from=build /usr/src/app/build /usr/src/app/build
COPY --from=build /usr/src/app/bin /usr/src/app/bin
COPY --from=build /usr/src/app/config /usr/src/app/config
COPY --from=base /usr/src/app/node_modules /usr/src/app/node_modules
COPY docker-hc /usr/src/app/