-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (29 loc) · 1.12 KB
/
Dockerfile
File metadata and controls
36 lines (29 loc) · 1.12 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
# 1. BUILD STAGE
FROM node:22 AS build
USER node
WORKDIR /app
COPY --chown=node:node . .
ENV CI=true
# Installiert ALLES (auch devDependencies für Gulp)
RUN yarn install --network-timeout 1000000 --network-concurrency 1
RUN yarn gulp release
# 2. DEPENDENCY CLEANUP STAGE (Optional aber schick)
# Wir werfen die devDependencies weg, damit das Image klein bleibt
RUN rm -rf node_modules
RUN yarn install --production --frozen-lockfile && yarn cache clean
# 3. DEPLOY STAGE
FROM node:22-slim AS deploy
LABEL org.opencontainers.image.source=https://github.com/leylines/leylinesMap
LABEL org.opencontainers.image.description="Dockerimage for leylinesMap"
USER node
WORKDIR /app
# Wir kopieren die gesäuberten node_modules komplett
COPY --from=build --chown=node:node /app/node_modules ./node_modules
COPY --from=build --chown=node:node /app/wwwroot ./wwwroot
COPY --from=build /app/serverconfig.json ./serverconfig.json
COPY --from=build /app/package.json ./package.json
# ... weitere Files
EXPOSE 3001
ENV NODE_ENV=production
# Dein Startbefehl
CMD [ "node", "./node_modules/leylines-server/lib/app.js", "--config-file", "serverconfig.json" ]