-
Notifications
You must be signed in to change notification settings - Fork 0
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
63 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,32 @@ | ||
# Define build-time variables | ||
ARG VERSION | ||
|
||
# Stage 1: Build (pulled from upstream Dockerfile https://github.com/botlabs-gg/yagpdb/blob/7e6d553bd203680a0a1d68afd94f815478538611/yagpdb_docker/Dockerfile) | ||
FROM docker.io/library/golang:1.21.6-bookworm AS builder | ||
ARG VERSION | ||
|
||
ADD https://github.com/botlabs-gg/yagpdb/archive/refs/tags/v${VERSION}.tar.gz /source.tar.gz | ||
RUN tar -C /go/src -xvf /source.tar.gz | ||
RUN rm /source.tar.gz | ||
|
||
WORKDIR /go/src/yagpdb-${VERSION} | ||
ENV GOPATH /go | ||
|
||
RUN go mod download && go mod verify | ||
WORKDIR /go/src/yagpdb-${VERSION}/cmd/yagpdb | ||
RUN CGO_ENABLED=0 GOOS=linux go build -o /yagpdb -v -ldflags="-X github.com/botlabs-gg/yagpdb/v2/common.VERSION=v${VERSION}" | ||
|
||
# Stage 2: Working app image | ||
#FROM gcr.io/distroless/cc-debian12:nonroot@sha256:6cf8f0fafa8b4b911eefa9be9e2fe40fcf380f56de25d203dd9a3782c255d1f3 | ||
FROM gcr.io/distroless/static-debian12:nonroot@sha256:39ae7f0201fee13b777a3e4a5a9326a8889269172c8b4f4289d9f19c831f45f4 | ||
ARG VERSION | ||
WORKDIR /app | ||
|
||
ADD --chmod=555 --chown=1000:1000 --checksum=sha256:af8a43230338de67563878a25872ee2fd3d6af0f3513d55dd1ec672ad69dae53 https://github.com/openSUSE/catatonit/releases/download/v0.2.0/catatonit.x86_64 /catatonit | ||
COPY --from=builder /yagpdb /app/yagpdb | ||
|
||
USER 1000:1000 | ||
EXPOSE 8080/tcp | ||
VOLUME ["/app/soundboard"] | ||
ENTRYPOINT ["/catatonit", "--", "/app/yagpdb"] | ||
|
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,6 @@ | ||
--- | ||
# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port | ||
port: | ||
# https://github.com/aelsabbahy/goss/issues/149 | ||
tcp6:8080: | ||
listening: true |
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,9 @@ | ||
#!/usr/bin/env bash | ||
channel=$1 | ||
|
||
if [[ "${channel}" == "stable" ]]; then | ||
version="$(curl -sX GET "https://api.github.com/repos/botlabs-gg/yagpdb/releases/latest" | jq --raw-output '.tag_name' 2>/dev/null)" | ||
fi | ||
version="${version#*v}" | ||
version="${version#*release-}" | ||
printf "%s" "${version}" |
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,16 @@ | ||
--- | ||
app: yagpdb | ||
base: false | ||
channels: | ||
- &c | ||
name: stable | ||
platforms: | ||
- "linux/amd64" | ||
#- "linux/arm64" | ||
stable: true | ||
tests: | ||
enabled: false # TODO: pass env vars and/or args to `dgoss run` tests: "invalid config: host must be set" | ||
# type: web | ||
#- <<: *c | ||
# name: master | ||
# stable: false |