fix dockerfile and improved docker workflow
Signed-off-by: Simon Smith <simonsmith5521@gmail.com>
Simon Smith committed
Oct 27, 2025 at 09:29 UTC
4137132701b64d2571d167250e75a4556fb99607
2 files changed
+344
-115
.github/workflows/docker.yml
+338
-105
@@ -1,134 +1,367 @@
1
----
1
name: Docker-Builder
2
3
on:
4
workflow_dispatch:
6
- push:
7
- branches:
8
- - master
5
+ schedule:
6
+ - cron: '2 0 * * *' # Daily at 00:02 UTC
7
release:
8
types: [ published ]
9
12
-env:
13
- REGISTRY: ghcr.io
14
- IMAGE_NAME: ${{ github.repository || 'MeshCentral' }}
15
- REGISTRY_USERNAME: ${{ github.repository_owner || 'meshcentral-extensions' }}
16
-
10
jobs:
18
- build-images:
19
- name: Build Docker Images
20
- permissions:
21
- packages: write
22
- contents: read
23
- runs-on: ubuntu-latest
24
- strategy:
25
- #max-parallel: 1
26
- matrix:
27
- variant:
28
- - name: complete
29
- include_mongodb: true
30
- include_postgresql: true
31
- include_mysql: true
32
- tag_suffix: ""
33
- - name: mongodb
34
- include_mongodb: true
35
- include_postgresql: false
36
- include_mysql: false
37
- tag_suffix: "-mongodb"
38
- - name: postgresql
39
- include_mongodb: false
40
- include_postgresql: true
41
- include_mysql: false
42
- tag_suffix: "-postgresql"
43
- - name: mysql
44
- include_mongodb: false
45
- include_postgresql: false
46
- include_mysql: true
47
- tag_suffix: "-mysql"
48
- - name: slim
49
- include_mongodb: false
50
- include_postgresql: false
51
- include_mysql: false
52
- tag_suffix: "-slim"
11
12
+ translate:
13
+ runs-on: ubuntu-latest
14
+ name: Run Translations
15
steps:
16
- name: Checkout repository
17
uses: actions/checkout@v5
57
-
18
- name: Set up Node.js
59
- uses: actions/setup-node@v4
19
+ uses: actions/setup-node@v6
20
+ with:
21
+ node-version: "lts/*"
22
+ - name: Run translate.js (ignore errors)
23
+ run: node translate.js || true
24
+ working-directory: translate
25
+ - name: Run translate extractall
26
+ run: node translate extractall
27
+ working-directory: translate
28
+ - name: Run translate.js minifyall
29
+ run: node translate.js minifyall
30
+ working-directory: translate
31
+ - name: Run translate.js translateall
32
+ run: node translate.js translateall
33
+ working-directory: translate
34
+ - name: Upload repo with translations
35
+ uses: actions/upload-artifact@v5
36
with:
61
- node-version: 'lts/*'
37
+ name: repo-with-translations
38
+ path: .
39
40
+ build-amd64:
41
+ runs-on: ubuntu-latest
42
+ needs: translate
43
+ strategy:
44
+ fail-fast: false
45
+ matrix:
46
+ variant: [mongodb, postgresql, mariadb, all, slim]
47
+ name: Build Docker Image (amd64-${{ matrix.variant }})
48
+ steps:
49
+ - name: Download repo artifact
50
+ uses: actions/download-artifact@v5
51
+ with:
52
+ name: repo-with-translations
53
- name: Set up QEMU
54
uses: docker/setup-qemu-action@v3
65
-
55
+ with:
56
+ cache-image: false
57
+ platforms: amd64
58
- name: Set up Docker Buildx
59
uses: docker/setup-buildx-action@v3
68
-
69
- - name: Log in to the Container registry
60
+ with:
61
+ cache-binary: false
62
+ - name: Log in to GitHub Container Registry
63
uses: docker/login-action@v3
64
with:
72
- registry: ${{ env.REGISTRY }}
73
- username: ${{ env.REGISTRY_USERNAME }}
74
- password: ${{ secrets.MY_TOKEN }}
65
+ registry: ghcr.io
66
+ username: ${{ github.repository_owner }}
67
+ password: ${{ secrets.MY_TOKEN || secrets.GITHUB_TOKEN }}
68
+ - name: Build and push Docker image (amd64-${{ matrix.variant }})
69
+ run: |
70
+ REPO_OWNER_LC="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
71
+ case "${{ matrix.variant }}" in
72
+ mongodb)
73
+ MONGODB=YES; POSTGRESQL=NO; MARIADB=NO; TAG="-amd64-mongodb";;
74
+ postgresql)
75
+ MONGODB=NO; POSTGRESQL=YES; MARIADB=NO; TAG="-amd64-postgresql";;
76
+ mariadb)
77
+ MONGODB=NO; POSTGRESQL=NO; MARIADB=YES; TAG="-amd64-mariadb";;
78
+ all)
79
+ MONGODB=YES; POSTGRESQL=YES; MARIADB=YES; TAG="-amd64";;
80
+ slim)
81
+ MONGODB=NO; POSTGRESQL=NO; MARIADB=NO; TAG="-amd64-slim";;
82
+ esac
83
+ docker buildx build \
84
+ --platform linux/amd64 \
85
+ --build-arg INCLUDE_MONGODB_TOOLS=$MONGODB \
86
+ --build-arg INCLUDE_POSTGRESQL_TOOLS=$POSTGRESQL \
87
+ --build-arg INCLUDE_MARIADB_TOOLS=$MARIADB \
88
+ --build-arg DISABLE_MINIFY=yes \
89
+ --build-arg DISABLE_TRANSLATE=yes \
90
+ --build-arg DISABLE_EXTRACT=yes \
91
+ --build-arg PREINSTALL_LIBS=true \
92
+ -f docker/Dockerfile \
93
+ -t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}$TAG \
94
+ --push \
95
+ .
96
76
- - name: Extract metadata (tags, labels) for Docker
77
- id: meta
78
- uses: docker/metadata-action@v5
79
- with:
80
- images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
81
- github-token: ${{ secrets.MY_TOKEN }}
82
- env:
83
- DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
97
+ build-arm64:
98
+ runs-on: ubuntu-latest
99
+ needs: translate
100
+ strategy:
101
+ fail-fast: false
102
+ matrix:
103
+ variant: [mongodb, postgresql, mariadb, all, slim]
104
+ name: Build Docker Image (arm64-${{ matrix.variant }})
105
+ steps:
106
+ - name: Download repo artifact
107
+ uses: actions/download-artifact@v5
108
+ with:
109
+ name: repo-with-translations
110
+ - name: Set up QEMU
111
+ uses: docker/setup-qemu-action@v3
112
+ with:
113
+ cache-image: false
114
+ platforms: arm64
115
+ - name: Set up Docker Buildx
116
+ uses: docker/setup-buildx-action@v3
117
+ with:
118
+ cache-binary: false
119
85
- - name: Install Translate Packages (allowed to fail)
86
- working-directory: ./translate
87
- run: node translate.js || true
120
+ - name: Log in to GitHub Container Registry
121
+ uses: docker/login-action@v3
122
+ with:
123
+ registry: ghcr.io
124
+ username: ${{ github.repository_owner }}
125
+ password: ${{ secrets.MY_TOKEN || secrets.GITHUB_TOKEN }}
126
+ - name: Build and push Docker image (arm64-${{ matrix.variant }})
127
+ run: |
128
+ REPO_OWNER_LC="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
129
+ case "${{ matrix.variant }}" in
130
+ mongodb)
131
+ MONGODB=YES; POSTGRESQL=NO; MARIADB=NO; TAG="-arm64-mongodb";;
132
+ postgresql)
133
+ MONGODB=NO; POSTGRESQL=YES; MARIADB=NO; TAG="-arm64-postgresql";;
134
+ mariadb)
135
+ MONGODB=NO; POSTGRESQL=NO; MARIADB=YES; TAG="-arm64-mariadb";;
136
+ all)
137
+ MONGODB=YES; POSTGRESQL=YES; MARIADB=YES; TAG="-arm64";;
138
+ slim)
139
+ MONGODB=NO; POSTGRESQL=NO; MARIADB=NO; TAG="-arm64-slim";;
140
+ esac
141
+ docker buildx build \
142
+ --platform linux/arm64 \
143
+ --build-arg INCLUDE_MONGODB_TOOLS=$MONGODB \
144
+ --build-arg INCLUDE_POSTGRESQL_TOOLS=$POSTGRESQL \
145
+ --build-arg INCLUDE_MARIADB_TOOLS=$MARIADB \
146
+ --build-arg DISABLE_MINIFY=yes \
147
+ --build-arg DISABLE_TRANSLATE=yes \
148
+ --build-arg DISABLE_EXTRACT=yes \
149
+ --build-arg PREINSTALL_LIBS=true \
150
+ -f docker/Dockerfile \
151
+ -t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}$TAG \
152
+ --push \
153
+ .
154
89
- - name: Run extractall
90
- working-directory: ./translate
91
- run: node translate.js extractall
155
+ build-armv7:
156
+ runs-on: ubuntu-latest
157
+ needs: translate
158
+ strategy:
159
+ fail-fast: false
160
+ matrix:
161
+ variant: [mongodb, postgresql, mariadb, all, slim]
162
+ name: Build Docker Image (armv7-${{ matrix.variant }})
163
+ steps:
164
+ - name: Download repo artifact
165
+ uses: actions/download-artifact@v5
166
+ with:
167
+ name: repo-with-translations
168
+ - name: Set up QEMU
169
+ uses: docker/setup-qemu-action@v3
170
+ with:
171
+ cache-image: false
172
+ platforms: arm
173
+ - name: Set up Docker Buildx
174
+ uses: docker/setup-buildx-action@v3
175
+ with:
176
+ cache-binary: false
177
93
- - name: Run minifyall
94
- working-directory: ./translate
95
- run: node translate.js minifyall
178
+ - name: Log in to GitHub Container Registry
179
+ uses: docker/login-action@v3
180
+ with:
181
+ registry: ghcr.io
182
+ username: ${{ github.repository_owner }}
183
+ password: ${{ secrets.MY_TOKEN || secrets.GITHUB_TOKEN }}
184
+ - name: Build and push Docker image (armv7-${{ matrix.variant }})
185
+ run: |
186
+ REPO_OWNER_LC="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
187
+ case "${{ matrix.variant }}" in
188
+ mongodb)
189
+ MONGODB=YES; POSTGRESQL=NO; MARIADB=NO; TAG="-armv7-mongodb";;
190
+ postgresql)
191
+ MONGODB=NO; POSTGRESQL=YES; MARIADB=NO; TAG="-armv7-postgresql";;
192
+ mariadb)
193
+ MONGODB=NO; POSTGRESQL=NO; MARIADB=YES; TAG="-armv7-mariadb";;
194
+ all)
195
+ MONGODB=YES; POSTGRESQL=YES; MARIADB=YES; TAG="-armv7";;
196
+ slim)
197
+ MONGODB=NO; POSTGRESQL=NO; MARIADB=NO; TAG="-armv7-slim";;
198
+ esac
199
+ docker buildx build \
200
+ --platform linux/arm/v7 \
201
+ --build-arg INCLUDE_MONGODB_TOOLS=$MONGODB \
202
+ --build-arg INCLUDE_POSTGRESQL_TOOLS=$POSTGRESQL \
203
+ --build-arg INCLUDE_MARIADB_TOOLS=$MARIADB \
204
+ --build-arg DISABLE_MINIFY=yes \
205
+ --build-arg DISABLE_TRANSLATE=yes \
206
+ --build-arg DISABLE_EXTRACT=yes \
207
+ --build-arg PREINSTALL_LIBS=true \
208
+ -f docker/Dockerfile \
209
+ -t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}$TAG \
210
+ --push \
211
+ .
212
97
- - name: Run translateall
98
- working-directory: ./translate
99
- run: node translate.js translateall
213
+ build-armv6:
214
+ runs-on: ubuntu-latest
215
+ needs: translate
216
+ strategy:
217
+ fail-fast: false
218
+ matrix:
219
+ variant: [mongodb, postgresql, mariadb, all, slim]
220
+ name: Build Docker Image (armv6-${{ matrix.variant }})
221
+ steps:
222
+ - name: Download repo artifact
223
+ uses: actions/download-artifact@v5
224
+ with:
225
+ name: repo-with-translations
226
+ - name: Set up QEMU
227
+ uses: docker/setup-qemu-action@v3
228
+ with:
229
+ cache-image: false
230
+ platforms: arm
231
+ - name: Set up Docker Buildx
232
+ uses: docker/setup-buildx-action@v3
233
+ with:
234
+ cache-binary: false
235
101
- - name: process tags with suffix
102
- id: clean-tag
236
+ - name: Log in to GitHub Container Registry
237
+ uses: docker/login-action@v3
238
+ with:
239
+ registry: ghcr.io
240
+ username: ${{ github.repository_owner }}
241
+ password: ${{ secrets.MY_TOKEN || secrets.GITHUB_TOKEN }}
242
+ - name: Build and push Docker image (armv6-${{ matrix.variant }})
243
run: |
104
- SUFFIX="${{ matrix.variant.tag_suffix }}"
105
- # Read each line into an array
106
- mapfile -t TAGS <<< "${{ steps.meta.outputs.tags }}"
107
-
108
- RESULT=""
109
- for tag in "${TAGS[@]}"; do
110
- if [ -n "$RESULT" ]; then
111
- RESULT+=","
112
- fi
113
- RESULT+="${tag}${SUFFIX}"
114
- done
115
-
116
- echo "TAGS_WITH_SUFFIX=$RESULT" >> $GITHUB_ENV
244
+ REPO_OWNER_LC="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
245
+ case "${{ matrix.variant }}" in
246
+ mongodb)
247
+ MONGODB=YES; POSTGRESQL=NO; MARIADB=NO; TAG="-armv6-mongodb";;
248
+ postgresql)
249
+ MONGODB=NO; POSTGRESQL=YES; MARIADB=NO; TAG="-armv6-postgresql";;
250
+ mariadb)
251
+ MONGODB=NO; POSTGRESQL=NO; MARIADB=YES; TAG="-armv6-mariadb";;
252
+ all)
253
+ MONGODB=YES; POSTGRESQL=YES; MARIADB=YES; TAG="-armv6";;
254
+ slim)
255
+ MONGODB=NO; POSTGRESQL=NO; MARIADB=NO; TAG="-armv6-slim";;
256
+ esac
257
+ docker buildx build \
258
+ --platform linux/arm/v6 \
259
+ --build-arg INCLUDE_MONGODB_TOOLS=$MONGODB \
260
+ --build-arg INCLUDE_POSTGRESQL_TOOLS=$POSTGRESQL \
261
+ --build-arg INCLUDE_MARIADB_TOOLS=$MARIADB \
262
+ --build-arg DISABLE_MINIFY=yes \
263
+ --build-arg DISABLE_TRANSLATE=yes \
264
+ --build-arg DISABLE_EXTRACT=yes \
265
+ --build-arg PREINSTALL_LIBS=true \
266
+ -f docker/Dockerfile \
267
+ -t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}$TAG \
268
+ --push \
269
+ .
270
118
- - name: Build and push Docker image
119
- uses: docker/build-push-action@v6
120
- with:
121
- context: .
122
- file: docker/Dockerfile
123
- platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
124
- push: true
125
- tags: ${{ env.TAGS_WITH_SUFFIX }}
126
- labels: ${{ steps.meta.outputs.labels }}
127
- annotations: ${{ steps.meta.outputs.annotations }}
128
- build-args: |
129
- INCLUDE_MONGODB_TOOLS=${{ matrix.variant.include_mongodb }}
130
- INCLUDE_POSTGRESQL_TOOLS=${{ matrix.variant.include_postgresql }}
131
- INCLUDE_MARIADB_TOOLS=${{ matrix.variant.include_mysql }}
132
- DISABLE_MINIFY=yes
133
- DISABLE_TRANSLATE=yes
134
- PREINSTALL_LIBS=true
271
+ merge-manifest:
272
+ runs-on: ubuntu-latest
273
+ needs:
274
+ - translate
275
+ - build-amd64
276
+ - build-arm64
277
+ - build-armv7
278
+ - build-armv6
279
+ name: Create and Push Multi-Arch Manifest
280
+ steps:
281
+ - name: Set up Docker Buildx
282
+ uses: docker/setup-buildx-action@v3
283
+ with:
284
+ cache-binary: false
285
+ - name: Log in to GitHub Container Registry
286
+ uses: docker/login-action@v3
287
+ with:
288
+ registry: ghcr.io
289
+ username: ${{ github.repository_owner }}
290
+ password: ${{ secrets.MY_TOKEN || secrets.GITHUB_TOKEN }}
291
+ - name: Create and push multi-arch manifests for all variants
292
+ run: |
293
+ REPO_OWNER_LC="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
294
+ # mongodb
295
+ docker buildx imagetools create \
296
+ -t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-mongodb \
297
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-mongodb \
298
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-mongodb \
299
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7-mongodb \
300
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6-mongodb
301
+ # postgresql
302
+ docker buildx imagetools create \
303
+ -t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-postgresql \
304
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-postgresql \
305
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-postgresql \
306
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7-postgresql \
307
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6-postgresql
308
+ # mariadb
309
+ docker buildx imagetools create \
310
+ -t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-mariadb \
311
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-mariadb \
312
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-mariadb \
313
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7-mariadb \
314
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6-mariadb
315
+ # all (no suffix)
316
+ docker buildx imagetools create \
317
+ -t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }} \
318
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64 \
319
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64 \
320
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7 \
321
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6
322
+ # slim
323
+ docker buildx imagetools create \
324
+ -t ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-slim \
325
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-slim \
326
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-slim \
327
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7-slim \
328
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6-slim
329
+ - name: Create and push 'latest' tags (releases only)
330
+ if: github.event_name == 'release'
331
+ run: |
332
+ REPO_OWNER_LC="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
333
+ # latest-mongodb
334
+ docker buildx imagetools create \
335
+ -t ghcr.io/$REPO_OWNER_LC/meshcentral:latest-mongodb \
336
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-mongodb \
337
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-mongodb \
338
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7-mongodb \
339
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6-mongodb
340
+ # latest-postgresql
341
+ docker buildx imagetools create \
342
+ -t ghcr.io/$REPO_OWNER_LC/meshcentral:latest-postgresql \
343
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-postgresql \
344
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-postgresql \
345
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7-postgresql \
346
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6-postgresql
347
+ # latest-mariadb
348
+ docker buildx imagetools create \
349
+ -t ghcr.io/$REPO_OWNER_LC/meshcentral:latest-mariadb \
350
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-mariadb \
351
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-mariadb \
352
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7-mariadb \
353
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6-mariadb
354
+ # latest (all databases)
355
+ docker buildx imagetools create \
356
+ -t ghcr.io/$REPO_OWNER_LC/meshcentral:latest \
357
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64 \
358
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64 \
359
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7 \
360
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6
361
+ # latest-slim
362
+ docker buildx imagetools create \
363
+ -t ghcr.io/$REPO_OWNER_LC/meshcentral:latest-slim \
364
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-amd64-slim \
365
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-arm64-slim \
366
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv7-slim \
367
+ ghcr.io/$REPO_OWNER_LC/meshcentral:${{ github.ref_name }}-armv6-slim
docker/Dockerfile
+6
-10
@@ -38,8 +38,7 @@ RUN if [ -n "$DISABLE_MINIFY" ] || [ -n "$DISABLE_TRANSLATE" ]; then \
38
fi
39
# Possible more updated alternative? @minify-html/node@0.15.0 -> https://www.npmjs.com/package/@minify-html/node
40
41
-RUN rm -rf /opt/meshcentral/meshcentral/docker
42
-RUN rm -rf /opt/meshcentral/meshcentral/node_modules
41
+RUN rm -rf /opt/meshcentral/meshcentral/docker /opt/meshcentral/meshcentral/node_modules /opt/meshcentral/meshcentral/docs
42
43
### STAGE 2 PRECOMPILE DEPS MODULE
44
@@ -50,12 +49,10 @@ RUN apk update && \
49
apk add --no-cache --update \
50
bash gcc g++ jq make nodejs npm python3 tzdata
51
53
-RUN mkdir -p /opt/meshcentral
54
-COPY ./package.json /opt/meshcentral/package.json
55
-WORKDIR /opt/meshcentral
52
+COPY --from=builder /opt/meshcentral/meshcentral /opt/meshcentral/meshcentral
53
+WORKDIR /opt/meshcentral/meshcentral
54
57
-RUN jq '.dependencies["modern-syslog"] = "1.2.0"' package.json > tmp.$$.json \
58
- && mv tmp.$$.json package.json \
55
+RUN jq '.dependencies += {"modern-syslog": "1.2.0", "telegram": "2.26.22"}' package.json > temp.json && mv temp.json package.json \
56
&& npm i --package-lock-only \
57
&& npm ci
58
@@ -63,9 +60,8 @@ RUN jq '.dependencies["modern-syslog"] = "1.2.0"' package.json > tmp.$$.json \
60
61
FROM alpine:3.22 AS runtime
62
66
-# Copy prepared app from builder stage
67
-COPY --from=builder /opt/meshcentral/meshcentral /opt/meshcentral/meshcentral
68
-COPY --from=dep-compiler /opt/meshcentral/node_modules /opt/meshcentral/meshcentral/node_modules
63
+# # Copy prepared app from builder stage
64
+COPY --from=dep-compiler /opt/meshcentral/meshcentral /opt/meshcentral/meshcentral
65
66
# environment variables
67
ENV NODE_ENV="production" \