2024-11-04 15:09:32 +00:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
FROM node:20-alpine AS base
|
|
|
|
|
|
|
|
ENV PNPM_HOME="/pnpm"
|
|
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
|
|
RUN corepack enable
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
FROM base AS prod-deps
|
|
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
|
|
|
|
|
|
|
|
FROM base AS build
|
|
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
|
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store cd admin && pnpm install --frozen-lockfile
|
|
|
|
RUN pnpm build
|
|
|
|
RUN cd admin && pnpm build
|
|
|
|
|
|
|
|
FROM base AS main
|
|
|
|
COPY --from=prod-deps /app/node_modules /app/node_modules
|
2024-11-04 17:31:08 +00:00
|
|
|
COPY --from=build /app/build /app/build
|
|
|
|
COPY --from=build /app/admin/dist /app/admin/dist
|
2024-11-04 15:09:32 +00:00
|
|
|
|
|
|
|
COPY ./public ./public
|
|
|
|
|
2024-11-04 17:31:08 +00:00
|
|
|
# Required by Cloudron
|
|
|
|
HEALTHCHECK CMD curl --fail http://localhost:3000 || exit 1
|
|
|
|
|
|
|
|
# Cloudron specific labels
|
|
|
|
LABEL cloudronManifestPath="CloudronManifest.json"
|
|
|
|
|
2024-11-04 15:09:32 +00:00
|
|
|
VOLUME [ "/app/data" ]
|
|
|
|
EXPOSE 3000
|
|
|
|
|
|
|
|
ENV DEBUG="blossom-server,blossom-server:*"
|
2024-11-04 17:31:08 +00:00
|
|
|
ENV PORT=3000
|
2024-11-04 15:09:32 +00:00
|
|
|
|
|
|
|
ENTRYPOINT [ "node", "." ]
|