-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
82 lines (66 loc) · 1.62 KB
/
Dockerfile
File metadata and controls
82 lines (66 loc) · 1.62 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
from node:18.20.8-slim as build
run \
<<EOF
set -eu
corepack enable
corepack prepare pnpm@8.3.1 --activate
EOF
run \
--mount=type=bind,source=/package.json,target=/src/package.json \
--mount=type=bind,source=/pnpm-lock.yaml,target=/src/pnpm-lock.yaml \
--mount=type=cache,target=/pnpm-store,sharing=locked \
<<EOF
set -eu
cd /src
mkdir -p /build
cp package.json pnpm-lock.yaml /build
cd /build
export CI=true
export NODE_ENV=
pnpm config set store-dir /pnpm-store
pnpm install --prod
cd /src
mkdir -p /dist
cp package.json pnpm-lock.yaml /dist
cd /dist
export CI=true
export NODE_ENV=
pnpm config set store-dir /pnpm-store
pnpm install
EOF
run \
--mount=type=bind,source=/,target=/src \
--mount=type=cache,target=/pnpm-store,sharing=locked \
<<EOF
set -eu
cd /src
cp -r tsconfig.json src etc /dist
cd /dist
export CI=true
export NODE_ENV=
pnpm run build
EOF
from node:18.20.8-slim
run \
--mount=type=bind,from=build,source=/build,target=/build \
--mount=type=bind,from=build,source=/dist,target=/dist \
--mount=type=bind,source=/,target=/src \
<<EOF
set -eu
mkdir -p /usr/local/lib/daxfb_blueprints
cd /build
cp -a node_modules /usr/local/lib/daxfb_blueprints
cd /dist
cp -a package.json /usr/local/lib/daxfb_blueprints
cd /dist/dist
cp -a * /usr/local/lib/daxfb_blueprints
mkdir -p /docker
cd /src
cp entrypoint.sh /docker/entrypoint.sh
chmod 755 /docker/entrypoint.sh
EOF
workdir /usr/local/lib/daxfb_blueprints
entrypoint [ "/docker/entrypoint.sh" ]
cmd [ "run" ]
expose 8080/tcp
volume [ "/usr/local/lib/daxfb_blueprints/etc/config.json" ]