-
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.
* Add github action * Update base image, add user to runtime * Update kubernetes manifest example
- Loading branch information
Showing
6 changed files
with
60 additions
and
20 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,20 @@ | ||
name: docker-build | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
steam-gameserver-token-api: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: steam-gameserver-token-api | ||
uses: docker/build-push-action@v1 | ||
with: | ||
push: false | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | ||
repository: npflan/steam-gameserver-token-api | ||
tags: 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,18 @@ | ||
name: docker-push | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
steam-gameserver-token-api: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: steam-gameserver-token-api | ||
uses: docker/build-push-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | ||
repository: npflan/steam-gameserver-token-api | ||
tags: latest,${{ github.event.release.tag_name }} |
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 |
---|---|---|
@@ -1,16 +1,18 @@ | ||
FROM golang:1.11.0 AS base | ||
FROM golang:1.17.1-alpine AS builder | ||
RUN mkdir -p /go/src/github.com/npflan/steam-gameserver-token-api | ||
WORKDIR /go/src/github.com/npflan/steam-gameserver-token-api | ||
COPY . . | ||
RUN apt -y update && apt -y install musl-tools ca-certificates | ||
RUN go get -d . && \ | ||
CC=$(which musl-gcc) go build --ldflags '-w -linkmode external -extldflags "-static"' . | ||
CGO_ENABLED=0 GOOS=linux go build -a -o steam-gameserver-token-api . | ||
|
||
FROM alpine:3.7 | ||
FROM alpine:3.14 | ||
RUN addgroup -g 1000 -S go && \ | ||
adduser -u 1000 -S username -G go && \ | ||
adduser -u 1000 -S web -G go && \ | ||
apk add --no-cache ca-certificates tzdata | ||
WORKDIR /home/go | ||
COPY --from=base /go/src/github.com/npflan/steam-gameserver-token-api/steam-gameserver-token-api /home/go | ||
EXPOSE 80 | ||
WORKDIR /home/web | ||
COPY --from=builder /go/src/github.com/npflan/steam-gameserver-token-api/steam-gameserver-token-api /home/web | ||
EXPOSE 8000 | ||
|
||
USER web | ||
|
||
CMD ["./steam-gameserver-token-api"] |
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
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 |
---|---|---|
@@ -1,4 +1,2 @@ | ||
github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= | ||
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= | ||
github.com/gorilla/mux v1.6.2 h1:Pgr17XVTNXAk3q/r4CpKzC5xBM/qW1uVLV+IhRZpIIk= | ||
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= | ||
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= | ||
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= |
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