Files
scratchbox/docker-entrypoint.sh
T
s1d3sw1ped 4579443d09
CI / Go Tests (push) Successful in 12s
CI / Build (push) Successful in 11s
Format / gofmt (push) Successful in 6s
Release Artifacts / Validate release tag (push) Successful in 2s
Release Artifacts / Build and release executables (push) Successful in 16s
Release Artifacts / Build and release Docker image (push) Successful in 26s
Enforce environment variable configuration for Docker entrypoint
- Updated `docker-entrypoint.sh` to disallow custom command-line arguments, requiring configuration through `SCRATCHBOX_*` environment variables.
- Modified `README.md` to clarify that custom container commands are not supported and to reflect the new entrypoint behavior.
- Enhanced `main_test.go` to validate failure when required environment variables are not set.
- Added a function in `server.go` to print startup environment variables, ensuring visibility of configuration during server initialization.
2026-06-01 05:06:57 -05:00

23 lines
638 B
Bash

#!/bin/sh
set -eu
# Container-enforced data directory.
SCRATCHBOX_STORAGE_DATA_DIR=/data
export SCRATCHBOX_STORAGE_DATA_DIR
# Container-enforced listen address/port.
SCRATCHBOX_SERVER_LISTEN_ADDR=:8080
export SCRATCHBOX_SERVER_LISTEN_ADDR
# Container-enforced access log behavior: stdout only (no file sink).
SCRATCHBOX_SERVER_ACCESS_LOG_FILE_PATH=
export SCRATCHBOX_SERVER_ACCESS_LOG_FILE_PATH
# Entrypoint is fixed for Docker deployments; custom args are not supported.
if [ "$#" -ne 0 ]; then
echo "custom entrypoint arguments are not supported; configure via SCRATCHBOX_* env vars" >&2
exit 2
fi
exec scratchbox server --env