Update service & better docker image
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Ada 2024-04-01 23:50:43 +02:00
parent b8bf9de3ec
commit 0cb7f195ad
Signed by: ada
GPG key ID: 6A7F898157C6DE6E
8 changed files with 18 additions and 64 deletions

View file

@ -3,7 +3,7 @@ steps:
image: woodpeckerci/plugin-docker-buildx image: woodpeckerci/plugin-docker-buildx
settings: settings:
repo: git.gnous.eu/${CI_REPO_OWNER}/wiki repo: git.gnous.eu/${CI_REPO_OWNER}/wiki
dockerfile: docker/Dockerfile dockerfile: Dockerfile
platforms: linux/amd64 platforms: linux/amd64
registry: https://git.gnous.eu registry: https://git.gnous.eu
tag: ${CI_COMMIT} tag: ${CI_COMMIT}
@ -14,4 +14,4 @@ steps:
when: when:
branch: ${CI_REPO_DEFAULT_BRANCH} branch: ${CI_REPO_DEFAULT_BRANCH}
event: push event: push

14
Dockerfile Normal file
View file

@ -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

View file

@ -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"]

View file

@ -1,12 +0,0 @@
version: "3"
services:
www:
build:
context: ../
dockerfile: docker/Dockerfile
restart: always
container_name: www
ports:
- "3000:3000"

View file

@ -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"

View file

@ -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)
}

View file

@ -10,5 +10,5 @@ Hyperviseur sous Proxmox hébergé chez Scaleway. Il héberge actuellement (et
- Mastodon - Mastodon
- Woodpecker - 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.

View file

@ -3,7 +3,7 @@
Une alternative décentralisée a Twitter sur le fédiverse, basée sur [Mastodon](https://joinmastodon.org/) Une alternative décentralisée a Twitter sur le fédiverse, basée sur [Mastodon](https://joinmastodon.org/)
## GnousGit ## 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 ## Woodpecker
Un système de CI/CD basé sur [Woodpecker](https://woodpecker-ci.org/). Un système de CI/CD basé sur [Woodpecker](https://woodpecker-ci.org/).