Skip to content

Commit

Permalink
Merge pull request #6 from dvh/patch-2
Browse files Browse the repository at this point in the history
Update _dockerfile-pnpm.mdx
  • Loading branch information
dvh authored Dec 11, 2024
2 parents 5c6b67d + e0439bd commit 0c74384
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/deployment/docker/_partials/_dockerfile-pnpm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Stage 1: Base image.
## Start with a base image containing NodeJS so we can build Docusaurus.
FROM node:lts as base
FROM node:lts AS base
## Disable colour output from yarn to make logs easier to read.
ENV FORCE_COLOR=0
## Enable corepack.
Expand All @@ -12,7 +12,7 @@ RUN corepack enable
WORKDIR /opt/docusaurus
# Stage 2a: Development mode.
FROM base as dev
FROM base AS dev
## Set the working directory to `/opt/docusaurus`.
WORKDIR /opt/docusaurus
## Expose the port that Docusaurus will run on.
Expand All @@ -21,7 +21,7 @@ EXPOSE 3000
CMD [ -d "node_modules" ] && pnpm start --host 0.0.0.0 --poll 1000 || pnpm install && pnpm start --host 0.0.0.0 --poll 1000
# Stage 2b: Production build mode.
FROM base as prod
FROM base AS prod
## Set the working directory to `/opt/docusaurus`.
WORKDIR /opt/docusaurus
## Copy over the source code.
Expand All @@ -32,14 +32,14 @@ RUN pnpm install --frozen-lockfile
RUN pnpm build
# Stage 3a: Serve with `docusaurus serve`.
FROM prod as serve
FROM prod AS serve
## Expose the port that Docusaurus will run on.
EXPOSE 3000
## Run the production server.
CMD ["pnpm", "serve", "--host", "0.0.0.0", "--no-open"]
# Stage 3b: Serve with Caddy.
FROM caddy:2-alpine as caddy
FROM caddy:2-alpine AS caddy
## Copy the Caddyfile.
COPY --from=prod /opt/docusaurus/Caddyfile /etc/caddy/Caddyfile
## Copy the Docusaurus build output.
Expand Down

0 comments on commit 0c74384

Please sign in to comment.