1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-28 13:48:49 +08:00

MF-846 - Install python in docker build for aedes mqtt image (#860)

* Multi-stage docker build for aedes mqtt image

Signed-off-by: Ivan Milošević <iva@blokovi.com>

* Add copyright header

Signed-off-by: Ivan Milošević <iva@blokovi.com>
This commit is contained in:
Ivan Milošević 2019-09-16 18:25:34 +02:00 committed by Nikola Marčetić
parent 5ef6aa84de
commit a6cf76709d

View File

@ -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 FROM node:10.15.1-alpine
## Copy built node modules and binaries without including the toolchain
COPY --from=builder node_modules .
COPY *.proto mqtt/* ./ COPY *.proto mqtt/* ./
RUN npm rebuild && npm install
EXPOSE 1883 8880 EXPOSE 1883 8880
CMD ["node", "mqtt.js"] CMD ["node", "mqtt.js"]