Skip to content

Commit 6b57870

Browse files
committed
security updates
1 parent c74e8b7 commit 6b57870

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

Dockerfile

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM node:22-slim
1+
# Stage 1: Install dependencies
2+
FROM node:22-slim AS build
23

34
LABEL maintainer="OpenZiti <openziti@netfoundry.io>"
45

@@ -14,33 +15,29 @@ WORKDIR /home/node/ziti-browzer-bootstrapper
1415
COPY --chown=node:node package.json ./
1516
COPY --chown=node:node yarn.lock ./
1617

17-
# Install yarn 4
18-
RUN corepack enable
19-
RUN corepack prepare yarn@4.0.2 --activate
20-
21-
# # Install the dependencies for the Ziti BrowZer Bootstrapper
22-
# RUN yarn install
18+
# Install Yarn 4 globally
19+
RUN corepack enable && yarn set version stable
2320

2421
# Bring in the source of the Ziti BrowZer Bootstrapper to the working folder
2522
COPY --chown=node:node index.js .
2623
COPY --chown=node:node zha-docker-entrypoint .
2724
COPY --chown=node:node lib ./lib/
2825
COPY --chown=node:node assets ./assets/
2926

30-
# FROM node:22-slim
27+
# Install dependencies (ensuring node_modules remains)
28+
RUN yarn install --immutable
3129

32-
# RUN apt-get update && apt-get install curl -y
30+
# Stage 2: Production-ready image
31+
FROM node:22-slim
3332

34-
# COPY --from=build /home/node/ziti-browzer-bootstrapper /home/node/ziti-browzer-bootstrapper
33+
WORKDIR /home/node/ziti-browzer-bootstrapper
34+
35+
# Copy installed node_modules from build stage
36+
COPY --from=build /home/node/ziti-browzer-bootstrapper /home/node/ziti-browzer-bootstrapper
3537

3638
RUN chown -R node:node /home/node/ziti-browzer-bootstrapper
3739
USER node
3840

39-
# Install the dependencies for the Ziti BrowZer Bootstrapper
40-
RUN yarn config set nodeLinker node-modules && yarn install && ls -l
41-
42-
# WORKDIR /home/node/ziti-browzer-bootstrapper
43-
4441
# Expose the Ziti BrowZer Bootstrapper for traffic to be proxied (8000) and the
4542
# REST API where it can be configured (8001)
4643
EXPOSE 8000

0 commit comments

Comments
 (0)