From dfb6e2b7027b52f50aac8106a821b81a96211059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20B=C3=BClow?= Date: Thu, 19 Dec 2024 17:34:32 +0100 Subject: [PATCH] added Dockerfile and compose file --- .woodpecker.yml | 24 ++++++++++++++++++++++++ Dockerfile | 13 +++++++++++++ docker-compose.yml | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 .woodpecker.yml create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..c841f0c --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,24 @@ +when: + - branch: main + event: push + + +variables: + - &file Dockerfile + - &repo git.jmbit.de/${CI_REPO_OWNER}/${CI_REPO_NAME} + +steps: + build: + image: woodpeckerci/plugin-docker-buildx + settings: + dockerfile: *file + platforms: linux/arm64/v8,linux/amd64 + repo: *repo + registry: git.jmbit.de + tags: latest + username: ${CI_REPO_OWNER} + password: + from_secret: forgejo_token + when: + event: push + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e8ab876 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +ARG CADDY_VERSION=2.8 +FROM caddy:${CADDY_VERSION}-builder-alpine AS builder + +RUN xcaddy build \ + --with github.com/lucaslorentz/caddy-docker-proxy/v2 \ + --with github.com/mholt/caddy-l4 + +FROM caddy:${CADDY_VERSION}-alpine + +COPY --from=builder /usr/bin/caddy /usr/bin/caddy + +CMD ["caddy", "docker-proxy"] + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..131aaa2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,33 @@ +services: + caddy: + image: git.jmbit.de/jmb/caddy-proxy + container_name: "caddy" + ports: + - "80:80" + - "443:443" + volumes: + - "/srv/caddy/data:/data" + - "/srv/caddy/Caddyfile:/Caddyfile" + - "/var/run/docker.sock:/var/run/docker.sock:ro" + networks: + - caddy-network + environment: + - "CADDY_DOCKER_CADDYFILE_PATH=/Caddyfile" + www: + container_name: www-jmbit-de + image: git.jmbit.de/jmb/www-jmbit-de + restart: unless-stopped + networks: + - caddy-network + expose: + - 80 + labels: + caddy: www.jmbit.de + caddy.reverse_proxy: "{{upstreams 80}}" + caddy.0_header: server Potato +networks: + caddy-network: + driver: bridge + name: caddy-network + external: true +