fix: use debian-based container for image building
All checks were successful
Build and push Docker image / build (push) Successful in 2m26s
All checks were successful
Build and push Docker image / build (push) Successful in 2m26s
fixes https://stackoverflow.com/a/75730731
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -1,19 +1,19 @@
|
|||||||
# Credit: https://www.digitalocean.com/community/tutorials/how-to-build-a-node-js-application-with-docker
|
# Credit: https://www.digitalocean.com/community/tutorials/how-to-build-a-node-js-application-with-docker
|
||||||
|
|
||||||
FROM node:22-alpine AS builder
|
FROM node:24-trixie-slim AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm ci --only=production && npm cache clean --force
|
RUN npm ci --only=production && npm cache clean --force
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
FROM node:22-alpine AS production
|
FROM node:24-trixie-slim AS production
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN addgroup -g 1001 -S nodejs && \
|
RUN addgroup --gid 1001 nodejs && \
|
||||||
adduser -S js -u 1001
|
adduser --gid 1001 --uid 1001 nodejs
|
||||||
COPY --from=builder --chown=js:nodejs /app /app
|
COPY --from=builder --chown=nodejs:nodejs /app /app
|
||||||
USER js
|
USER nodejs
|
||||||
EXPOSE 6567
|
EXPOSE 6567
|
||||||
|
|
||||||
CMD ["npm", "run", "server"]
|
CMD ["npm", "run", "server"]
|
||||||
Reference in New Issue
Block a user