File tree Expand file tree Collapse file tree 5 files changed +62
-0
lines changed Expand file tree Collapse file tree 5 files changed +62
-0
lines changed Original file line number Diff line number Diff line change 1
1
CORROSION_IMAGE ?= ghcr.io/psviderski/corrosion:latest
2
2
UCIND_IMAGE ?= ghcr.io/psviderski/ucind:latest
3
+ DOCS_IMAGE ?= ghcr.io/psviderski/uncloud-docs:latest
3
4
4
5
update-dev :
5
6
GOOS=linux GOARCH=amd64 go build -o uncloudd-linux-amd64 ./cmd/uncloudd && \
68
69
.PHONY : vet
69
70
vet :
70
71
go vet ./...
72
+
73
+ .PHONY : docs-image-push
74
+ docs-image :
75
+ docker buildx build --push --platform linux/amd64,linux/arm64 -t " $( DOCS_IMAGE) " ./docs
Original file line number Diff line number Diff line change
1
+ # Ignore everything and use an allowlist of what is allowed to not package any secrets by accident.
2
+ *
3
+
4
+ # Allow files and directories.
5
+ ! docs /
6
+ ! src /
7
+ ! static /
8
+ ! pkg /
9
+ ! Caddyfile
10
+ ! * .js
11
+ ! * .json
12
+
13
+ # Ignore unnecessary files inside allowed directories.
14
+ ** /.DS_Store
Original file line number Diff line number Diff line change
1
+ {
2
+ admin off
3
+ }
4
+
5
+ :8000 {
6
+ root * /usr/share/caddy
7
+ file_server
8
+ try_files {path} /index.html
9
+ }
Original file line number Diff line number Diff line change
1
+ # Stage 1: Base image.
2
+ # # Start with a base image containing NodeJS so we can build Docusaurus.
3
+ FROM node:lts-alpine AS base
4
+ # # Disable colour output from yarn to make logs easier to read.
5
+ ENV FORCE_COLOR=0
6
+ # # Enable corepack.
7
+ RUN corepack enable
8
+ # # Set the working directory to `/opt/docusaurus`.
9
+ WORKDIR /opt/docusaurus
10
+
11
+ # Stage 2: Production build.
12
+ FROM base AS prod
13
+ # # Set the working directory to `/opt/docusaurus`.
14
+ WORKDIR /opt/docusaurus
15
+ # # Copy over the source code.
16
+ COPY . /opt/docusaurus/
17
+ # # Install dependencies with `--immutable` to ensure reproducibility.
18
+ RUN npm ci
19
+ # # Build the static site.
20
+ RUN npm run build
21
+
22
+ # Stage 3: Serve static site with Caddy.
23
+ FROM caddy:2.10.0-alpine AS caddy
24
+ # # Copy the Caddyfile.
25
+ COPY ./Caddyfile /etc/caddy/Caddyfile
26
+ # # Copy the Docusaurus build output.
27
+ COPY --from=prod /opt/docusaurus/build /usr/share/caddy
Original file line number Diff line number Diff line change
1
+ services :
2
+ uncloud-docs :
3
+ image : ghcr.io/psviderski/uncloud-docs:latest
4
+ pull_policy : always
5
+ user : nobody
6
+ x-ports :
7
+ - docs.uncloud.run:8000/https
You can’t perform that action at this time.
0 commit comments