diff --git a/.woodpecker/build.yaml b/.woodpecker.yaml similarity index 91% rename from .woodpecker/build.yaml rename to .woodpecker.yaml index ed6024f..aaf118a 100644 --- a/.woodpecker/build.yaml +++ b/.woodpecker.yaml @@ -3,7 +3,7 @@ steps: image: woodpeckerci/plugin-docker-buildx settings: repo: git.gnous.eu/${CI_REPO_OWNER}/wiki - dockerfile: docker/Dockerfile + dockerfile: Dockerfile platforms: linux/amd64 registry: https://git.gnous.eu tag: ${CI_COMMIT} @@ -14,4 +14,4 @@ steps: when: branch: ${CI_REPO_DEFAULT_BRANCH} event: push - + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..84feef0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +# Build +FROM alpine:latest AS build +LABEL authors="gnousEU" + +WORKDIR /build +COPY . . + +RUN apk add wget gzip tar && \ + wget -O mdbook.tar.gz https://github.com/rust-lang/mdBook/releases/download/v0.4.37/mdbook-v0.4.37-x86_64-unknown-linux-musl.tar.gz && \ + tar xvf mdbook.tar.gz && \ + ./mdbook build + +FROM ghcr.io/static-web-server/static-web-server:2.28 +COPY --from=build /build/book /public diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index e08047a..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM golang:1.22 as build - -WORKDIR /build -COPY . . - -RUN wget https://github.com/rust-lang/mdBook/releases/download/v0.4.37/mdbook-v0.4.37-x86_64-unknown-linux-gnu.tar.gz -RUN tar xvf mdbook-v0.4.37-x86_64-unknown-linux-gnu.tar.gz -RUN ./mdbook build - -RUN CGO_ENABLED=0 go build -ldflags "-w -s" docker/serve.go - -FROM gcr.io/distroless/static-debian12:nonroot - -WORKDIR /app - -COPY --from=build /build/serve . -COPY --from=build /build/book/ static/ - -EXPOSE 3000 - -CMD ["/app/serve"] \ No newline at end of file diff --git a/docker/docker-compose.dev.yaml b/docker/docker-compose.dev.yaml deleted file mode 100644 index 6ef0df0..0000000 --- a/docker/docker-compose.dev.yaml +++ /dev/null @@ -1,12 +0,0 @@ -version: "3" - -services: - www: - build: - context: ../ - dockerfile: docker/Dockerfile - restart: always - container_name: www - ports: - - "3000:3000" - diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml deleted file mode 100644 index bd17832..0000000 --- a/docker/docker-compose.yaml +++ /dev/null @@ -1,18 +0,0 @@ -version: "3" - -networks: - plakken: - external: false - -volumes: - redis: - driver: local - -services: - server: - image: git.gnous.eu/gnouseu/wiki:latest - restart: always - container_name: plakken - read_only: true - ports: - - "3000:3000" diff --git a/docker/serve.go b/docker/serve.go deleted file mode 100644 index 37c15c9..0000000 --- a/docker/serve.go +++ /dev/null @@ -1,9 +0,0 @@ -package main - -import "net/http" - -func main() { - fs := http.FileServer(http.Dir("./static")) - http.Handle("GET /", fs) - http.ListenAndServe(":3000", nil) -} diff --git a/src/infra.md b/src/infra.md index 8cd20c5..2fa92b8 100644 --- a/src/infra.md +++ b/src/infra.md @@ -10,5 +10,5 @@ Hyperviseur sous Proxmox hébergé chez Scaleway. Il héberge actuellement (et - Mastodon - Woodpecker -Les services tourne sur docker (TODO: ouvrir le repo au public) et les machines virtuels sont configurées via Ansible (TODO: ouvrir le repo au public) +Les services tourne sur docker et les machines virtuels sont configurées via Ansible et tourne sur Ubuntu. diff --git a/src/service.md b/src/service.md index 3cc7641..053d649 100644 --- a/src/service.md +++ b/src/service.md @@ -3,7 +3,7 @@ Une alternative décentralisée a Twitter sur le fédiverse, basée sur [Mastodon](https://joinmastodon.org/) ## GnousGit -Une forge git basée sur [Gitea](https://about.gitea.com/). Il y a aussi une CI/CD basée sur [Woodpecker](#woodpecker) +Une forge git basée sur [Forgejo](https://forgejo.org/). Il y a aussi une CI/CD basée sur [Woodpecker](#woodpecker) ## Woodpecker Un système de CI/CD basé sur [Woodpecker](https://woodpecker-ci.org/).