From a6cf76709dbfa9dbbfbb3f5fdf9d80030e643a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Milo=C5=A1evi=C4=87?= Date: Mon, 16 Sep 2019 18:25:34 +0200 Subject: [PATCH] MF-846 - Install python in docker build for aedes mqtt image (#860) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Multi-stage docker build for aedes mqtt image Signed-off-by: Ivan Milošević * Add copyright header Signed-off-by: Ivan Milošević --- mqtt/aedes/Dockerfile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/mqtt/aedes/Dockerfile b/mqtt/aedes/Dockerfile index a0a30bf1..b34a250b 100644 --- a/mqtt/aedes/Dockerfile +++ b/mqtt/aedes/Dockerfile @@ -1,9 +1,18 @@ +# Copyright (c) Mainflux +# SPDX-License-Identifier: Apache-2.0 + +FROM node:10.15.1-alpine as builder + +## Install build toolchain, install node deps and compile native add-ons +RUN apk add --no-cache python make g++ +COPY mqtt/aedes/package.json . +RUN npm rebuild && npm install --only=production + FROM node:10.15.1-alpine - +## Copy built node modules and binaries without including the toolchain +COPY --from=builder node_modules . COPY *.proto mqtt/* ./ -RUN npm rebuild && npm install - EXPOSE 1883 8880 -CMD ["node", "mqtt.js"] +CMD ["node", "mqtt.js"] \ No newline at end of file