Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve(feat): Imagebuild and Imagesize #876

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 43 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,53 @@
FROM node:21.4.0-alpine3.17
FROM node:21.4.0 AS builder
AndreasHeine marked this conversation as resolved.
Show resolved Hide resolved

WORKDIR /home/node/opcua-server
RUN node -v

# hadolint ignore=DL3018
RUN apk --no-cache add \
openssl=3.0.15-r0 \
python3=3.10.15-r0 \
make=4.3-r1 \
g++=12.2.1_git20220924-r4 \
gcc=12.2.1_git20220924-r4
WORKDIR /home/node

COPY . /home/node/opcua-server
COPY . /home/node

RUN chown -R node:node /home/node

USER node

RUN npm -v
RUN npm install

EXPOSE 4840
RUN npm run pretest

RUN chown -R node:node /home/node/opcua-server
FROM node:21.4.0-alpine3.17 AS production
AndreasHeine marked this conversation as resolved.
Show resolved Hide resolved

USER node

ENTRYPOINT ["npm", "run", "start"]
WORKDIR /home/node

COPY --from=builder /home/node/dst/ ./dst/
COPY --from=builder /home/node/node_modules ./node_modules

EXPOSE 4840

ENTRYPOINT ["node", "./dst/server.js"]

# FROM node:21.4.0-alpine3.17
AndreasHeine marked this conversation as resolved.
Show resolved Hide resolved

AndreasHeine marked this conversation as resolved.
Show resolved Hide resolved
# WORKDIR /home/node/opcua-server

# # hadolint ignore=DL3018
# RUN apk --no-cache add \
# openssl=3.0.14-r0 \
# python3=3.10.14-r1 \
# make=4.3-r1 \
# g++=12.2.1_git20220924-r4 \
# gcc=12.2.1_git20220924-r4

# COPY . /home/node/opcua-server

# RUN npm install

# EXPOSE 4840

# RUN chown -R node:node /home/node/opcua-server

# USER node

# ENTRYPOINT ["npm", "run", "start"]