File tree Expand file tree Collapse file tree 2 files changed +27
-18
lines changed Expand file tree Collapse file tree 2 files changed +27
-18
lines changed Original file line number Diff line number Diff line change 44# Tip: Modify "docker-build" options in project.json to change docker build args.
55#
66# Run the container with `docker run -p 3000:3000 -t lit-auth-server`.
7- FROM docker.io/node:lts-alpine
7+ FROM --platform=linux/amd64 docker.io/node:lts-alpine
88
9+ ENV NODE_ENV=production
910ENV HOST=0.0.0.0
1011ENV PORT=3000
1112
@@ -14,12 +15,15 @@ WORKDIR /app
1415RUN addgroup --system lit-auth-server && \
1516 adduser --system -G lit-auth-server lit-auth-server
1617
17- COPY dist/apps/lit-auth-server lit-auth-server/
18- COPY apps/lit-auth-server/package.json lit-auth-server/
19- RUN chown -R lit-auth-server:lit-auth-server .
18+ COPY dist/apps/lit-auth-server/ ./
2019
21- # You can remove this install step if you build with `--bundle` option.
22- # The bundled output will include external dependencies.
23- RUN npm --prefix lit-auth-server --omit=dev -f install
20+ # Install only production deps from the generated package.json/lockfile
21+ RUN corepack enable && pnpm install --prod --frozen-lockfile --ignore-scripts
2422
25- CMD [ "node" , "lit-auth-server" ]
23+ # Drop privileges
24+ USER lit-auth-server
25+
26+ ENV NODE_OPTIONS="--no-deprecation"
27+
28+ EXPOSE 3000
29+ CMD ["node" , "main.cjs" ]
Original file line number Diff line number Diff line change 44# Tip: Modify "docker-build" options in project.json to change docker build args.
55#
66# Run the container with `docker run -p 3000:3000 -t lit-login-server`.
7- FROM docker.io/node:lts-alpine
7+ FROM --platform=linux/amd64 docker.io/node:lts-alpine
88
9+ ENV NODE_ENV=production
910ENV HOST=0.0.0.0
1011ENV PORT=3000
1112
1213WORKDIR /app
1314
14- RUN addgroup --system lit-login-server && \
15- adduser --system -G lit-login-server lit-login-server
15+ # Create non-root user
16+ RUN addgroup --system lit-login-server && adduser --system -G lit-login-server lit-login-server
1617
17- COPY dist/apps/lit-login-server lit-login-server/
18- COPY apps/lit-login-server/package.json lit-login-server/
19- RUN chown -R lit-login-server:lit-login-server .
18+ # Copy Nx build artefacts (includes generated package.json and lockfile)
19+ COPY dist/apps/lit-login-server/ ./
2020
21- # You can remove this install step if you build with `--bundle` option.
22- # The bundled output will include external dependencies.
23- RUN npm --prefix lit-login-server --omit=dev -f install
21+ # Install only production deps from the generated package.json/lockfile
22+ RUN corepack enable && pnpm install --prod --frozen-lockfile --ignore-scripts
2423
25- CMD [ "node" , "lit-login-server" ]
24+ # Drop privileges
25+ USER lit-login-server
26+
27+ ENV NODE_OPTIONS="--no-deprecation"
28+
29+ EXPOSE 3001
30+ CMD ["node" , "main.cjs" ]
You can’t perform that action at this time.
0 commit comments