forked from gdgpescara/hedwig
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
29 lines (27 loc) · 927 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
COPY . /app
WORKDIR /app
FROM base AS build
ARG FIREBASE_CONFIG_ARG
ARG FIREBASE_SERVICE_ACCOUNT_ARG
ARG FIREBASE_STORAGE_BUCKET_ARG
ENV PUBLIC_FIREBASE_CONFIG=$FIREBASE_CONFIG_ARG
ENV PUBLIC_FIREBASE_SERVICE_ACCOUNT=$FIREBASE_SERVICE_ACCOUNT_ARG
ENV PUBLIC_FIREBASE_STORAGE_BUCKET=$FIREBASE_STORAGE_BUCKET_ARG
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --no-frozen-lockfile
RUN pnpm run build
FROM base
COPY --from=build /app/dist /app/dist
COPY --from=build /app/node_modules /app/node_modules
ARG FIREBASE_CONFIG_ARG
ARG FIREBASE_SERVICE_ACCOUNT_ARG
ENV PUBLIC_FIREBASE_CONFIG=$FIREBASE_CONFIG_ARG
ENV PUBLIC_FIREBASE_SERVICE_ACCOUNT=$FIREBASE_SERVICE_ACCOUNT_ARG
ENV PUBLIC_FIREBASE_STORAGE_BUCKET=$FIREBASE_STORAGE_BUCKET_ARG
ENV HOST=0.0.0.0
ENV PORT=4321
EXPOSE 4321
CMD node /app/dist/server/entry.mjs