forked from eclipse-iofog/Controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.rel
43 lines (27 loc) · 1 KB
/
Dockerfile.rel
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
FROM node:hydrogen-bookworm AS builder
ARG PKG_VERSION
WORKDIR /tmp
# Required by node-gyp
RUN apt install python3
RUN npm i -g npm
COPY package.json .
COPY . .
RUN npm i
RUN npm version $PKG_VERSION --allow-same-version
RUN npm pack
FROM node:hydrogen-alpine3.17
RUN apk add sudo logrotate g++ make
COPY logrotate.conf /etc/logrotate.conf
# Install python/pip
ENV PYTHONUNBUFFERED=1
RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
RUN python3 -m ensurepip
RUN pip3 install --no-cache --upgrade pip setuptools
LABEL org.opencontainers.image.description controller
LABEL org.opencontainers.image.source=https://github.com/datasance/controller
LABEL org.opencontainers.image.licenses=EPL2.0
COPY --from=builder /tmp/datasance-iofogcontroller-*.tgz /tmp/iofog-controller.tgz
RUN npm i -g /tmp/iofog-controller.tgz && \
rm -rf /tmp/iofog-controller.tgz && \
iofog-controller config dev-mode --on
CMD [ "node", "/usr/local/lib/node_modules/@datasance/iofogcontroller/src/server.js" ]