MeetUp/Dockerfile
dominik 2f320e924e
All checks were successful
container-scan / Container Scan (pull_request) Successful in 1m23s
docker-build / docker (pull_request) Successful in 4m1s
chore: use alpine runner container
Use nodejs alpine as the container image to run the app in.
Also adds a shell into the container.

Fixes the problem with prisma not starting in the container because it was compiled for a different version of openssl 3.3.x
2025-05-19 16:58:22 +02:00

39 lines
929 B
Docker

FROM node:22-alpine@sha256:152270cd4bd094d216a84cbc3c5eb1791afb05af00b811e2f0f04bdc6c473602 AS base
# ----- Dependencies -----
FROM base AS deps
WORKDIR /app
RUN corepack enable
COPY package.json yarn.lock .yarnrc.yml ./
RUN yarn install --frozen-lockfile
# ----- Build -----
FROM base AS builder
WORKDIR /app
RUN corepack enable
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN yarn build
# ----- Runner -----
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
LABEL org.opencontainers.image.source="https://git.dominikstahl.dev/DHBW-WE/MeetUp"
LABEL org.opencontainers.image.title="MeetUp"
LABEL org.opencontainers.image.description="A web application for managing meetups"
EXPOSE 3000
ENV HOSTNAME="0.0.0.0"
CMD ["server.js"]