mirror of
https://github.com/Dokploy/website.git
synced 2026-06-15 20:25:25 +02:00
refactor: update dockerfile
This commit is contained in:
34
Dockerfile.website
Normal file
34
Dockerfile.website
Normal file
@@ -0,0 +1,34 @@
|
||||
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 --frozen-lockfile
|
||||
|
||||
# Deploy only the dokploy app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
RUN pnpm run build
|
||||
|
||||
RUN cp -R /usr/src/app/apps/website/.next .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
|
||||
Reference in New Issue
Block a user