16 Commits

Author SHA1 Message Date
45f1250d9c use BUNDLE_PATH in COPY
Some checks failed
Gitea Actions Demo / lint (push) Successful in 19s
Gitea Actions Demo / test (push) Successful in 23s
Gitea Actions Demo / docker (push) Has been cancelled
2025-04-30 16:43:08 -05:00
0e52df2fac ensure that the application is not writable by kubernaut 2025-04-30 16:40:58 -05:00
d894d1f87f create system user and group for kubernaut 2025-04-30 16:34:51 -05:00
df86eec943 remove commented out line 2025-04-30 16:20:53 -05:00
cc5704506b whitespace fix 2025-04-30 16:20:32 -05:00
16441acd93 change the application user to be kubernaut 2025-04-30 16:16:24 -05:00
0397423eb6 make WORKDIR /kubernaut 2025-04-30 16:14:17 -05:00
ce89aad06a tidy up after bundler 2025-04-30 16:11:47 -05:00
e5dd7d499d explicitly copy Gemfile and Gemfile.lock 2025-04-30 16:03:04 -05:00
6759d15095 fix bundler environment variables 2025-04-30 15:55:23 -05:00
dc6b9ff20e clean up apk/apt caches 2025-04-30 15:55:06 -05:00
7dc8642321 make apk/apt update quiter 2025-04-30 15:54:22 -05:00
8c528bb7cb use full registry path in Dockerfile 2025-04-30 15:23:33 -05:00
7db559e848 add basic Docker entrypoint script 2025-04-30 14:56:36 -05:00
bcce68ad1f add bash to Alpine Docker image 2025-04-30 14:56:00 -05:00
239df00c92 v0.2.0
All checks were successful
Gitea Actions Demo / lint (push) Successful in 22s
Gitea Actions Demo / test (push) Successful in 16s
Gitea Actions Demo / docker (push) Successful in 3m12s
2025-04-29 15:07:36 -05:00
10 changed files with 51 additions and 14 deletions

View File

@@ -85,9 +85,6 @@ jobs:
printf "GITHUB_SHA=%s\n" "$GITHUB_SHA"
printf "VERSION=%s\n" "$VERSION" | tee -a "$GITHUB_OUTPUT"
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0

42
Dockerfile Normal file
View File

@@ -0,0 +1,42 @@
ARG RUBY_VERSION="3.4.3"
FROM ruby:${RUBY_VERSION} AS base
WORKDIR /app
RUN <<EOT
apt-get update
gem update --system --no-document
gem install -N bundler
EOT
FROM base AS build
RUN <<EOT
apt-get install --yes gcc make
EOT
COPY Gemfile* .
RUN <<EOT
bundle config set --local without development
bundle install
EOT
FROM base
ENV PORT=4567
# RUN useradd ruby --home /app --shell /bin/sh
RUN useradd --home /app --create-home app
USER app:app
COPY --from=build /usr/local/bundle /usr/local/bundle
COPY --from=build --chown=app:app /app /app
COPY --chown=app:app . .
EXPOSE 4567
CMD [ "puma", "--bind", "0.0.0.0", "--port", "$PORT" ]

View File

@@ -3,6 +3,7 @@ source "https://rubygems.org"
gem "sinatra"
gem "sinatra-contrib"
gem "puma"
gem "rackup"
gem "anyflake"
gem "ksuid"

View File

@@ -45,6 +45,8 @@ GEM
rack (>= 3.0.0)
rack-test (2.2.0)
rack (>= 1.3)
rackup (2.2.1)
rack (>= 3)
rainbow (3.1.1)
rake (13.2.1)
rbs (3.9.2)
@@ -136,6 +138,7 @@ DEPENDENCIES
nanoid
puma
rack-test
rackup
rake
rspec
ruby-lsp

2
app.rb
View File

@@ -21,7 +21,7 @@ $LOAD_PATH.unshift File.dirname(__FILE__) + "/lib"
require "config"
VERSION = "0.2.1"
VERSION = "0.2.0"
CHUNK_SIZE = 1024**2
SESSION_SECRET_HEX_LENGTH = 64

View File

@@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.1
version: 0.2.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.2.1"
appVersion: "0.2.0"

View File

@@ -5,7 +5,7 @@ WORKDIR /kubernaut
RUN <<EOT
apk update -q
apk add bash jemalloc
apk add bash
rm -rf /var/cache/apk
gem update --system --no-document
gem install -N bundler

View File

@@ -5,7 +5,6 @@ WORKDIR /kubernaut
RUN <<EOT
apt-get update -qq
apt-get install --yes --no-install-recommends libjemalloc2
rm -rf /var/lib/apt/lists /var/cache/apt/archives
gem update --system --no-document
gem install -N bundler

View File

@@ -7,9 +7,4 @@ ruby --version
printf "rubygems %s\n" "$(gem --version)"
bundle version
if [ -z "${LD_PRELOAD+x}" ]; then
LD_PRELOAD="$(find /usr/lib -name libjemalloc.so.2 -print -quit)"
export LD_PRELOAD
fi
exec "${@}"

View File

@@ -16,7 +16,7 @@ spec:
spec:
containers:
- name: kubernaut
image: git.kill0.net/ryanc/kubernaut:0.2.1
image: git.kill0.net/ryanc/kubernaut:0.2.0
imagePullPolicy: Always
ports:
- name: sinatra-web