This commit is contained in:
parent
abede92f3b
commit
b8bf9de3ec
5 changed files with 77 additions and 0 deletions
17
.woodpecker/build.yaml
Normal file
17
.woodpecker/build.yaml
Normal file
|
@ -0,0 +1,17 @@
|
|||
steps:
|
||||
- name: publish_image
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
settings:
|
||||
repo: git.gnous.eu/${CI_REPO_OWNER}/wiki
|
||||
dockerfile: docker/Dockerfile
|
||||
platforms: linux/amd64
|
||||
registry: https://git.gnous.eu
|
||||
tag: ${CI_COMMIT}
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
when:
|
||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||
event: push
|
||||
|
21
docker/Dockerfile
Normal file
21
docker/Dockerfile
Normal file
|
@ -0,0 +1,21 @@
|
|||
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"]
|
12
docker/docker-compose.dev.yaml
Normal file
12
docker/docker-compose.dev.yaml
Normal file
|
@ -0,0 +1,12 @@
|
|||
version: "3"
|
||||
|
||||
services:
|
||||
www:
|
||||
build:
|
||||
context: ../
|
||||
dockerfile: docker/Dockerfile
|
||||
restart: always
|
||||
container_name: www
|
||||
ports:
|
||||
- "3000:3000"
|
||||
|
18
docker/docker-compose.yaml
Normal file
18
docker/docker-compose.yaml
Normal file
|
@ -0,0 +1,18 @@
|
|||
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"
|
9
docker/serve.go
Normal file
9
docker/serve.go
Normal file
|
@ -0,0 +1,9 @@
|
|||
package main
|
||||
|
||||
import "net/http"
|
||||
|
||||
func main() {
|
||||
fs := http.FileServer(http.Dir("./static"))
|
||||
http.Handle("GET /", fs)
|
||||
http.ListenAndServe(":3000", nil)
|
||||
}
|
Loading…
Reference in a new issue