forked from symbol/symbol
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (30 loc) · 1.33 KB
/
Copy pathDockerfile
File metadata and controls
40 lines (30 loc) · 1.33 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
ARG UBUNTU_VERSION=24.04
ARG NODE_MAJOR=20
FROM ubuntu:${UBUNTU_VERSION} as builder
ARG NODE_MAJOR
ARG NODE_OPTIONS="--dns-result-order=ipv4first"
RUN apt-get update && apt-get upgrade -y && apt-get install -y curl gnupg \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" \
| tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get install -y nodejs
RUN apt-get install -y build-essential
WORKDIR /app
COPY . .
RUN npm uninstall . && rm -rf node_modules && npm install --omit=dev
FROM ubuntu:${UBUNTU_VERSION}
ARG NODE_MAJOR
RUN apt-get update && apt-get upgrade -y && apt-get install -y curl gnupg \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" \
| tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get install -y nodejs
USER ubuntu
WORKDIR /app
COPY --chown=1000:1000 --from=builder /app .
RUN node --version && npm --version
EXPOSE 3000