-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
54 lines (31 loc) · 1.02 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
47
48
49
50
51
52
# syntax=docker/dockerfile:1
#NOTE: when using alpine it seems building on arm via github actions hangs forever
# and we need node-gyp and other stuff. so the slim also doesnt work.
#### builder
FROM --platform=linux/amd64 node:22 AS builder
WORKDIR /app
COPY ["package.json", "package-lock.json*", "./"]
#will later be pruned
RUN npm install
COPY . .
RUN npm run build
RUN npm prune --production
### final stage amd64
FROM --platform=linux/amd64 node:22 AS ledder-amd64
ENV NODE_ENV=production
WORKDIR /app
COPY --from=builder /app /app
STOPSIGNAL SIGKILL
ENTRYPOINT [ "node","ledder/server/server.js" ]
### final stage for armv7 (for raspberry).
# (resuses most of amd64 builder for performance (qemu issues))
FROM --platform=linux/arm/v7 node:22 AS ledder-armv7
ENV NODE_ENV=production
RUN apt update && apt install -y build-essential cmake
COPY entrypoint.sh /
WORKDIR /app
COPY --from=builder /app /app
#rebuilds stuff for arm if needed
RUN npm rebuild --verbose
STOPSIGNAL SIGKILL
ENTRYPOINT [ "/entrypoint.sh" ]