-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathDockerfile.dev
More file actions
48 lines (30 loc) · 1.22 KB
/
Dockerfile.dev
File metadata and controls
48 lines (30 loc) · 1.22 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM node:iron-bookworm AS builder
ARG PKG_VERSION
ARG GITHUB_TOKEN
WORKDIR /tmp
RUN npm i -g npm
COPY package.json .
COPY . .
# Set GitHub npm registry with authentication token
RUN sed -i.back "s|PAT|${GITHUB_TOKEN}|g" .npmrc
RUN npm config set @eclipse-iofog:registry https://npm.pkg.github.com/
RUN npm i --build-from-source --force
RUN npm version $PKG_VERSION --allow-same-version --no-git-tag-version
RUN npm pack
FROM node:iron-alpine3.18
RUN apk add sudo logrotate g++ make
ENV NODE_ENV=development
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
COPY --from=builder /tmp/eclipse-iofog-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
LABEL org.opencontainers.image.description=controller
LABEL org.opencontainers.image.source=https://github.com/eclipse-iofog/Controller
LABEL org.opencontainers.image.licenses=EPL2.0
CMD [ "node", "/usr/local/lib/node_modules/@eclipse-iofog/iofogcontroller/src/server.js" ]