From 6919525bab03ce7758a6dac57f921efc1450d4f0 Mon Sep 17 00:00:00 2001 From: WGOS Date: Wed, 29 Nov 2023 17:29:22 +0400 Subject: [PATCH] Init --- .github/workflows/build-docker.yml | 33 ++++++++++++++++++++++++++++++ Dockerfile | 12 +++++++++++ 2 files changed, 45 insertions(+) create mode 100644 .github/workflows/build-docker.yml create mode 100644 Dockerfile diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml new file mode 100644 index 0000000..743c074 --- /dev/null +++ b/.github/workflows/build-docker.yml @@ -0,0 +1,33 @@ +name: Build Docker + +on: + push: + branches: + - "main" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to GHCR + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + context: . + file: ./Dockerfile + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..291864d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +ARG CADDY_VERSION=2.7 +FROM caddy:${CADDY_VERSION}-builder AS builder + +RUN xcaddy build \ + --with github.com/lucaslorentz/caddy-docker-proxy/v2 \ + --with github.com/pberkel/caddy-storage-redis + +FROM caddy:${CADDY_VERSION}-alpine + +COPY --from=builder /usr/bin/caddy /usr/bin/caddy + +CMD ["caddy", "docker-proxy"]