diff --git a/.forgejo/workflows/docker-build.yaml b/.forgejo/workflows/docker-build.yaml new file mode 100644 index 0000000..d979642 --- /dev/null +++ b/.forgejo/workflows/docker-build.yaml @@ -0,0 +1,19 @@ +on: + push: + branches: + - 'main' +jobs: + build-container: + runs-on: docker + container: + image: library/docker:dind + steps: + - run: apk add --no-cache nodejs git + - name: login to container registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login --username "${GITHUB_ACTOR}" --password-stdin git.janky.solutions + - name: build container + uses: docker/build-push-action@v4 + with: + file: Containerfile + tags: git.janky.solutions/finn/s3-caching-proxy:latest + push: true diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..4f1f21b --- /dev/null +++ b/Containerfile @@ -0,0 +1,9 @@ +FROM library/golang:1.20 as build +ADD * /go/caching-proxy/ +WORKDIR /go/caching-proxy +ARG GOPROXY=direct +RUN CGO_ENABLED=0 go build . + +FROM gcr.io/distroless/base-debian11 +COPY --from=build /go/caching-proxy/caching-proxy /caching-proxy +ENTRYPOINT ["/caching-proxy"]