Changing Dockerfile
Some checks failed
Music Collection CI Workflow / test (./frontend) (push) Successful in 19s
Music Collection CI Workflow / test (./backend) (push) Successful in 22s
Music Collection CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/msuic-collection-backend, ./backend) (push) Successful in 49s
Music Collection CI Workflow / build-and-push-images (./frontend/Dockerfile, git.anatid.net/tabris/music-collection-frontend, ./frontend) (push) Failing after 45s
Music Collection CI Workflow / deploy (push) Has been skipped

This commit is contained in:
Phill Pover 2025-04-02 17:22:21 +01:00
parent 816a813857
commit 3b09eb4230

View File

@ -1,27 +1,13 @@
FROM node:18-alpine as base # Build Stage
RUN apk add --no-cache g++ make py3-pip libc6-compat FROM node:23-alpine AS build
WORKDIR /app
COPY package*.json ./
EXPOSE 3000
FROM base as builder
WORKDIR /app WORKDIR /app
COPY ./package*.json ./
RUN npm install
COPY . . COPY . .
RUN npm run build RUN npm run build
FROM base as production # Production Stage
WORKDIR /app FROM nginx:stable-alpine AS production
COPY --from=build /app/build /usr/share/nginx/html
ENV NODE_ENV=production EXPOSE 80
RUN npm ci CMD ["nginx", "-g", "daemon off;"]
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001
USER nextjs
COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/public ./public
CMD npm start