mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
chore: add Docker image for docs and Uncloud Compose deployment (dogfooding!)
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
# Stage 1: Base image.
|
||||
## Start with a base image containing NodeJS so we can build Docusaurus.
|
||||
FROM node:lts-alpine AS base
|
||||
## Disable colour output from yarn to make logs easier to read.
|
||||
ENV FORCE_COLOR=0
|
||||
## Enable corepack.
|
||||
RUN corepack enable
|
||||
## Set the working directory to `/opt/docusaurus`.
|
||||
WORKDIR /opt/docusaurus
|
||||
|
||||
# Stage 2: Production build.
|
||||
FROM base AS prod
|
||||
## Set the working directory to `/opt/docusaurus`.
|
||||
WORKDIR /opt/docusaurus
|
||||
## Copy over the source code.
|
||||
COPY . /opt/docusaurus/
|
||||
## Install dependencies with `--immutable` to ensure reproducibility.
|
||||
RUN npm ci
|
||||
## Build the static site.
|
||||
RUN npm run build
|
||||
|
||||
# Stage 3: Serve static site with Caddy.
|
||||
FROM caddy:2.10.0-alpine AS caddy
|
||||
## Copy the Caddyfile.
|
||||
COPY ./Caddyfile /etc/caddy/Caddyfile
|
||||
## Copy the Docusaurus build output.
|
||||
COPY --from=prod /opt/docusaurus/build /usr/share/caddy
|
||||
Reference in New Issue
Block a user