forked from Dokploy/dokploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.website
35 lines (25 loc) · 883 Bytes
/
Dockerfile.website
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
30
31
32
33
34
35
FROM node:18-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
FROM base AS build
COPY . /usr/src/app
WORKDIR /usr/src/app
# Install dependencies
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --filter=./apps/website --frozen-lockfile
# Deploy only the dokploy app
ENV NODE_ENV=production
RUN pnpm --filter=./apps/website run build
RUN pnpm --filter=./apps/website --prod deploy /prod/website
RUN cp -R /usr/src/app/apps/website/.next /prod/website/.next
FROM base AS dokploy
WORKDIR /app
# Set production
ENV NODE_ENV=production
# Copy only the necessary files
COPY --from=build /prod/website/.next ./.next
COPY --from=build /prod/website/public ./public
COPY --from=build /prod/website/package.json ./package.json
COPY --from=build /prod/website/node_modules ./node_modules
EXPOSE 3000
CMD HOSTNAME=0.0.0.0 && pnpm start