-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (30 loc) · 1.01 KB
/
Dockerfile
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
FROM oven/bun:debian AS builder
WORKDIR /builder
RUN apt update -y && apt install -y bash curl python3 python3-pip python-is-python3
SHELL ["/bin/bash", "-c"]
# Original code from https://stackoverflow.com/a/28390848/11853111
ENV nvm_dir /root/.nvm
ENV node_version 22
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.39.7/install.sh | bash \
&& . $nvm_dir/nvm.sh \
&& nvm install $node_version \
&& nvm alias default $node_version \
&& nvm use default
COPY . .
RUN bun install
RUN . $nvm_dir/nvm.sh && npm run build
FROM oven/bun:debian
WORKDIR /app
RUN apt update -y && apt install -y bash curl
SHELL ["/bin/bash", "-c"]
ENV nvm_dir /root/.nvm
ENV node_version 22
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.39.7/install.sh | bash \
&& . $nvm_dir/nvm.sh \
&& nvm install $node_version \
&& nvm alias default $node_version \
&& nvm use default
COPY . .
RUN bun install --production
COPY --from=builder /builder/dist ./dist
CMD ["node", "dist/main.js"]