Skip to content

Commit 323b857

Browse files
committed
feat: add docker build
1 parent af1125e commit 323b857

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/workflows/docker.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Build & Push to container registry
2+
3+
on:
4+
release:
5+
types: [created]
6+
push:
7+
branches:
8+
- main
9+
pull_request:
10+
branches:
11+
- "**"
12+
paths:
13+
- "Dockerfile"
14+
15+
jobs:
16+
docker:
17+
uses: nezuchan/workflows/.github/workflows/docker-build.yml@main
18+
secrets: inherit

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM golang:1.21-alpine as build-stage
2+
3+
WORKDIR /tmp/build
4+
5+
COPY . .
6+
7+
# Build the project
8+
RUN go build .
9+
10+
FROM alpine:3
11+
12+
LABEL name "PGSQL Auto Backup"
13+
LABEL maintainer "KagChi"
14+
15+
WORKDIR /app
16+
17+
# Install needed deps
18+
RUN apk add --no-cache tini
19+
20+
COPY --from=build-stage /tmp/build/pgsql-backup main
21+
22+
ENTRYPOINT ["tini", "--"]
23+
CMD ["/app/main"]

0 commit comments

Comments
 (0)