-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (38 loc) · 1.7 KB
/
Dockerfile
File metadata and controls
54 lines (38 loc) · 1.7 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
49
50
51
52
53
54
# Stage 1: Install dependencies
FROM node:22-slim AS build
LABEL maintainer="OpenZiti <openziti@netfoundry.io>"
# Install useful tools
RUN apt-get update
RUN apt-get install -y python3 build-essential curl
# Create directory for the Ziti BrowZer Bootstrapper, and explicitly set the owner of that new directory to the node user
RUN mkdir /home/node/ziti-browzer-bootstrapper
WORKDIR /home/node/ziti-browzer-bootstrapper
# Prepare for dependencies installation
COPY --chown=node:node package.json ./
COPY --chown=node:node yarn.lock ./
# Install Yarn 4 globally
RUN corepack enable && corepack prepare yarn@4.0.2 --activate && yarn config set nodeLinker node-modules
# Bring in the source of the Ziti BrowZer Bootstrapper to the working folder
COPY --chown=node:node index.js .
COPY --chown=node:node zha-docker-entrypoint .
COPY --chown=node:node lib ./lib/
COPY --chown=node:node assets ./assets/
# Install dependencies (ensuring node_modules remains)
RUN yarn install
RUN ls -l
# Stage 2: Production-ready image
FROM node:22-slim
RUN apt-get update && apt-get install -y curl
WORKDIR /home/node/ziti-browzer-bootstrapper
# Copy installed node_modules from build stage
COPY --from=build /home/node/ziti-browzer-bootstrapper /home/node/ziti-browzer-bootstrapper
RUN chown -R node:node /home/node/ziti-browzer-bootstrapper
USER node
# Expose the Ziti BrowZer Bootstrapper for traffic to be proxied (8000) and the
# REST API where it can be configured (8001)
EXPOSE 8000
EXPOSE 8443
# Put the Ziti BrowZer Bootstrapper on path for zha-docker-entrypoint
ENV PATH=/home/node/bin:$PATH
ENTRYPOINT ["/home/node/ziti-browzer-bootstrapper/zha-docker-entrypoint"]
# CMD ["node index.js > ./log/ziti-browzer-bootstrapper.log > 2&1"]