-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Docker | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Docker Login | ||
uses: azure/docker-login@v1 | ||
with: | ||
login-server: docker.pkg.github.com | ||
username: $GITHUB_ACTOR | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build | ||
run: docker build -t image . | ||
|
||
- name: Publish | ||
run: | | ||
docker tag image docker.pkg.github.com/pangbox/server/minibox:${GITHUB_SHA} | ||
docker push docker.pkg.github.com/pangbox/server/minibox:${GITHUB_SHA} | ||
docker tag image docker.pkg.github.com/pangbox/server/minibox:latest | ||
docker push docker.pkg.github.com/pangbox/server/minibox:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM docker.io/golang:1.20.5-alpine AS builder | ||
WORKDIR /src | ||
COPY go.mod . | ||
COPY go.sum . | ||
RUN go mod download | ||
COPY . . | ||
RUN go build -o /server ./cmd/minibox | ||
|
||
FROM docker.io/alpine:latest | ||
EXPOSE 8080/tcp 10101/tcp 20202/tcp 30303/tcp | ||
USER 1000:1000 | ||
COPY --from=builder /server /server | ||
WORKDIR /minibox | ||
VOLUME /minibox | ||
ENTRYPOINT ["/server", "-pangya_dir", "/pangya"] |