File tree Expand file tree Collapse file tree
install-bundler/bundler/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- FROM node:21.6-bookworm
1+ FROM node:21.6-bookworm as builder
22
33# Install dependencies
4- # Tini allows us to avoid several Docker edge cases, see https://github.com/krallin/tini.
5- # NOTE: See https://github.com/hexops/dockerfile#is-tini-still-required-in-2020-i-thought-docker-added-it-natively
6-
7- RUN apt-get update && apt-get install -y \
8- tini \
9- && rm -rf /var/lib/apt/lists/*
104
115# arguments
126ARG PORT=3000
137
148# Set up the directory
15- WORKDIR /relayer-node
9+ WORKDIR /bundler
1610
1711# Copy package files
1812COPY package.json yarn.lock ./
@@ -26,6 +20,16 @@ COPY . /relayer-node
2620# Build the application
2721RUN yarn run build
2822
23+ # Second stage
24+ FROM node:21.6-bookworm
25+
26+ # Tini allows us to avoid several Docker edge cases, see https://github.com/krallin/tini.
27+ # NOTE: See https://github.com/hexops/dockerfile#is-tini-still-required-in-2020-i-thought-docker-added-it-natively
28+
29+ RUN apt-get update && apt-get install -y \
30+ tini \
31+ && rm -rf /var/lib/apt/lists/*
32+
2933# Expose the port
3034EXPOSE 3000
3135
@@ -40,6 +44,10 @@ EXPOSE 3000
4044RUN addgroup --gid 10001 --system nonroot \
4145 && adduser --uid 10000 --system --ingroup nonroot --home /home/nonroot nonroot
4246
47+ WORKDIR /home/nonroot/bundler
48+ COPY --from=builder --chown=10000:10001 /bundler /home/nonroot/bundler
49+
50+
4351# Use the non-root user to run our application
4452USER nonroot
4553
Original file line number Diff line number Diff line change 1- FROM node:21.6-bookworm
1+ FROM node:21.6-bookworm as builder
22
33# Install dependencies
4- # Tini allows us to avoid several Docker edge cases, see https://github.com/krallin/tini.
5- # NOTE: See https://github.com/hexops/dockerfile#is-tini-still-required-in-2020-i-thought-docker-added-it-natively
6-
7- RUN apt-get update && apt-get install -y \
8- tini \
9- && rm -rf /var/lib/apt/lists/*
104
115# arguments
126ARG PORT=3000
137
148# Set up the directory
15- WORKDIR /home/nonroot/ bundler
9+ WORKDIR /bundler
1610
1711# Copy package files
1812COPY package.json yarn.lock ./
@@ -23,6 +17,17 @@ RUN yarn install
2317# Copy the rest of the files
2418COPY . .
2519
20+ # Second stage
21+ FROM node:21.6-bookworm
22+
23+ # Tini allows us to avoid several Docker edge cases, see https://github.com/krallin/tini.
24+ # NOTE: See https://github.com/hexops/dockerfile#is-tini-still-required-in-2020-i-thought-docker-added-it-natively
25+
26+ RUN apt-get update && apt-get install -y \
27+ tini \
28+ && rm -rf /var/lib/apt/lists/*
29+
30+
2631# Expose the port
2732EXPOSE 3000
2833
@@ -37,6 +42,9 @@ EXPOSE 3000
3742RUN addgroup --gid 10001 --system nonroot \
3843 && adduser --uid 10000 --system --ingroup nonroot --home /home/nonroot nonroot
3944
45+ WORKDIR /home/nonroot/bundler
46+ COPY --from=builder --chown=10000:10001 /bundler /home/nonroot/bundler
47+
4048# Use the non-root user to run our application
4149USER nonroot
4250
Original file line number Diff line number Diff line change 1- FROM node:21.6-bookworm
1+ FROM node:21.6-bookworm as builder
22
33# Install dependencies
4- # Tini allows us to avoid several Docker edge cases, see https://github.com/krallin/tini.
5- # NOTE: See https://github.com/hexops/dockerfile#is-tini-still-required-in-2020-i-thought-docker-added-it-natively
6-
7- RUN apt-get update && apt-get install -y \
8- tini \
9- && rm -rf /var/lib/apt/lists/*
104
115# Arguments
126ARG PORT=3000
137
148# Set up the directory
15- WORKDIR /relayer-node
9+ WORKDIR /bundler
1610
1711# Copy package files
1812COPY package.json yarn.lock ./
@@ -21,11 +15,21 @@ COPY package.json yarn.lock ./
2115RUN yarn install
2216
2317# Copy the rest of the files
24- COPY . /relayer-node
18+ COPY . /bundler
2519
2620# Build the application
2721RUN yarn run build
2822
23+ # Second stage
24+ FROM node:21.6-bookworm
25+
26+ # Tini allows us to avoid several Docker edge cases, see https://github.com/krallin/tini.
27+ # NOTE: See https://github.com/hexops/dockerfile#is-tini-still-required-in-2020-i-thought-docker-added-it-natively
28+
29+ RUN apt-get update && apt-get install -y \
30+ tini \
31+ && rm -rf /var/lib/apt/lists/*
32+
2933# Expose the port
3034EXPOSE 3000
3135
@@ -40,6 +44,9 @@ EXPOSE 3000
4044RUN addgroup --gid 10001 --system nonroot \
4145 && adduser --uid 10000 --system --ingroup nonroot --home /home/nonroot nonroot
4246
47+ WORKDIR /home/nonroot/bundler
48+ COPY --from=builder --chown=10000:10001 /bundler /home/nonroot/bundler
49+
4350# Use the non-root user to run our application
4451USER nonroot
4552
Original file line number Diff line number Diff line change 9595 {{- end }}
9696
9797 volumeMounts :
98- - mountPath : " /relayer-node /config.json.enc"
98+ - mountPath : " /home/nonroot/bundler /config.json.enc"
9999 name : gcpsecrets
100100 subPath : " config.json.enc"
101101
You can’t perform that action at this time.
0 commit comments