Skip to content

Commit

Permalink
add bun
Browse files Browse the repository at this point in the history
  • Loading branch information
EgoMaw committed Mar 26, 2024
1 parent d9ed31c commit b19f068
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/bunjs.yml
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 }}
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ Replace {{distribution}} with the one you want from above.
* [`Node 21`](/nodejs/21)
* `ghcr.io/egomaw/yolks:nodejs_21`

### [Bun](/bunjs)

* [`Bun Stable`](/bunjs/stable)
* `ghcr.io/egomaw/yolks:bunjs_stable`
* [`Bun Canary`](/bunjs/canary)
* `ghcr.io/egomaw/yolks:bunjs_canary`

### [PostgreSQL](/postgres)

* [`Postgres 9`](/postgres/9)
Expand Down
14 changes: 14 additions & 0 deletions bunjs/canary/Dockerfile
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"]
32 changes: 32 additions & 0 deletions bunjs/entrypoint.sh
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}
14 changes: 14 additions & 0 deletions bunjs/stable/Dockerfile
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"]

0 comments on commit b19f068

Please sign in to comment.