diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..adbe3bc --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,18 @@ +name: Build & Push to container registry + +on: + release: + types: [created] + push: + branches: + - main + pull_request: + branches: + - "**" + paths: + - "Dockerfile" + +jobs: + docker: + uses: nezuchan/workflows/.github/workflows/docker-build.yml@main + secrets: inherit \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3f4758b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM golang:1.21-alpine as build-stage + +WORKDIR /tmp/build + +COPY . . + +# Build the project +RUN go build . + +FROM alpine:3 + +LABEL name "Invoice Creator" +LABEL maintainer "KagChi" + +WORKDIR /app + +# Install needed deps +RUN apk add --no-cache tini + +COPY --from=build-stage /tmp/build/invoice-creator main + +ENTRYPOINT ["tini", "--"] +CMD ["/app/main"] \ No newline at end of file