-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
4 changed files
with
177 additions
and
74 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
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,71 @@ | ||
version: 2 | ||
before: | ||
hooks: | ||
- go mod tidy -v | ||
builds: | ||
- id: linux_arm64 | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=aarch64-linux-gnu-gcc | ||
ldflags: | ||
- -s -w | ||
- -X github.com/xos/serverstatus/service/singleton.Version={{.Version}} | ||
- -extldflags "-static -fpic" | ||
flags: | ||
- -trimpath | ||
goos: | ||
- linux | ||
goarch: | ||
- arm64 | ||
main: ./cmd/dashboard | ||
binary: dash-{{ .Os }}-{{ .Arch }} | ||
- id: linux_amd64 | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=x86_64-linux-gnu-gcc | ||
ldflags: | ||
- -s -w | ||
- -X github.com/xos/serverstatus/service/singleton.Version={{.Version}} | ||
- -extldflags "-static -fpic" | ||
flags: | ||
- -trimpath | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
main: ./cmd/dashboard | ||
binary: dash-{{ .Os }}-{{ .Arch }} | ||
- id: linux_s390x | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=s390x-linux-gnu-gcc | ||
ldflags: | ||
- -s -w | ||
- -X github.com/xos/serverstatus/service/singleton.Version={{.Version}} | ||
- -extldflags "-static -fpic" | ||
flags: | ||
- -trimpath | ||
goos: | ||
- linux | ||
goarch: | ||
- s390x | ||
main: ./cmd/dashboard | ||
binary: dash-{{ .Os }}-{{ .Arch }} | ||
- id: windows_amd64 | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=x86_64-w64-mingw32-gcc | ||
ldflags: | ||
- -s -w | ||
- -X github.com/xos/serverstatus/service/singleton.Version={{.Version}} | ||
- -extldflags "-static -fpic" | ||
flags: | ||
- -trimpath | ||
goos: | ||
- windows | ||
goarch: | ||
- amd64 | ||
main: ./cmd/dashboard | ||
binary: dash-{{ .Os }}-{{ .Arch }} | ||
snapshot: | ||
version_template: "dashboard" |
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,22 +1,20 @@ | ||
FROM ubuntu:focal-20221130 | ||
FROM alpine AS certs | ||
RUN apk update && apk add ca-certificates | ||
|
||
ENV TZ="Asia/Shanghai" | ||
FROM busybox:stable-musl | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
COPY --from=certs /etc/ssl/certs /etc/ssl/certs | ||
COPY ./script/entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
|
||
RUN export DEBIAN_FRONTEND="noninteractive" && \ | ||
apt update && apt install -y ca-certificates tzdata && \ | ||
update-ca-certificates && \ | ||
ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && \ | ||
dpkg-reconfigure tzdata && \ | ||
chmod +x /entrypoint.sh | ||
WORKDIR /dashboard | ||
COPY ./resource ./resource | ||
COPY dist/dash-${TARGETOS}-${TARGETARCH} ./app | ||
|
||
VOLUME ["/dashboard/data"] | ||
EXPOSE 80 2222 | ||
ARG TZ=Asia/Shanghai | ||
ENV TZ=$TZ | ||
ENTRYPOINT ["/entrypoint.sh"] |
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ import ( | |
"fmt" | ||
"log" | ||
"time" | ||
_ "time/tzdata" | ||
|
||
"github.com/ory/graceful" | ||
flag "github.com/spf13/pflag" | ||
|