forked from pelican-eggs/yolks
-
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
5 changed files
with
109 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,42 @@ | ||
name: build bunjs | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 0 * * 1" | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- bunjs/** | ||
jobs: | ||
push: | ||
name: "yolks:bunjs_${{ matrix.tag }}" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
tag: | ||
- canary | ||
- stable | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# Setup QEMU for ARM64 Build | ||
- uses: docker/setup-qemu-action@v3 | ||
- uses: docker/setup-buildx-action@v3 | ||
with: | ||
buildkitd-flags: --debug | ||
driver-opts: | | ||
image=moby/buildkit:latest | ||
- uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: docker/build-push-action@v5 | ||
with: | ||
context: ./bunjs | ||
file: ./bunjs/${{ matrix.tag }}/Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: | | ||
ghcr.io/egomaw/yolks:bunjs_${{ matrix.tag }} |
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,14 @@ | ||
FROM --platform=$TARGETOS/$TARGETARCH node:21-slim | ||
LABEL author="EgoMaw" maintainer="[email protected]" | ||
|
||
RUN apt-get update \ | ||
&& apt-get -y --no-install-recommends install gettext-base ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool tini \ | ||
&& useradd -m -d /home/container container | ||
|
||
USER container | ||
ENV USER=container HOME=/home/container | ||
WORKDIR /home/container | ||
|
||
COPY --chown=container --chmod=555 ./../entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/usr/bin/tini", "-g", "--"] | ||
CMD ["/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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
cd /home/container | ||
|
||
# Make internal Docker IP address available to processes. | ||
export INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') | ||
|
||
# Prevent git terminal prompts if .git exists | ||
if [ -d /home/container/.git ]; then | ||
export GIT_TERMINAL_PROMPT=0 | ||
fi | ||
|
||
# Print Node.js Version | ||
printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mnode -v\n" | ||
node -v | ||
|
||
# Run Preflight Script | ||
if [ -n "$PRE_STARTUP_SCRIPT" ]; then | ||
PRE_STARTUP_SCRIPT=$(echo "${PRE_STARTUP_SCRIPT}" | sed -e 's/{{/${/g' -e 's/}}/}/g') | ||
|
||
printf "\033[1;31mcontainer@pterodactyl~\033[0m Running Preflight Script...\n" | ||
eval "${PRE_STARTUP_SCRIPT}" | ||
fi | ||
|
||
# Convert all of the "{{VARIABLE}}" parts of the command into the expected shell | ||
# variable format of "${VARIABLE}" before evaluating the string and automatically | ||
# replacing the values. | ||
MODIFIED_STARTUP=$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g' | envsubst) | ||
|
||
printf "\033[1;33mcontainer@pterodactyl~ \033[0m%s\n" "$MODIFIED_STARTUP" | ||
|
||
# Run the Server | ||
exec ${MODIFIED_STARTUP} |
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,14 @@ | ||
FROM --platform=$TARGETOS/$TARGETARCH oven/bun:canary-slim | ||
LABEL author="EgoMaw" maintainer="[email protected]" | ||
|
||
RUN apt-get update \ | ||
&& apt-get -y --no-install-recommends install gettext-base ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool tini \ | ||
&& useradd -m -d /home/container container | ||
|
||
USER container | ||
ENV USER=container HOME=/home/container | ||
WORKDIR /home/container | ||
|
||
COPY --chown=container --chmod=555 ./../entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/usr/bin/tini", "-g", "--"] | ||
CMD ["/entrypoint.sh"] |