diff --git a/Dockerfile b/Dockerfile index 9ca614a..1fd5c12 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,18 @@ # Stage 1: Node image for building frontend assets -FROM node:20 AS base +FROM docker.io/node:20 AS base ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" RUN corepack enable COPY . /app WORKDIR /app -# Stage 2: Production dependencies -FROM base AS prod-deps -RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile - -# Stage 3: Build frontend assets -FROM base AS build +# Stage 2: Build frontend assets +FROM docker.io/base AS build RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile RUN pnpm run build -# Stage 4: Nginx for serving frontend assets -FROM nginx:alpine AS nginx +# Stage 3: Nginx for serving frontend assets +FROM docker.io/nginx:alpine AS nginx COPY ./nginx.conf /etc/nginx/nginx.conf RUN mkdir /app COPY --from=build /app/dist /app