Skip to content

Commit

Permalink
feat: add docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
KagChi committed Oct 17, 2023
1 parent f2237b5 commit 56f214e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 56f214e

Please sign in to comment.