v0.0.10
✨ New Features
Official Docker image
- Added a root-level
Dockerfileusing a three-stage multi-stage build:- Stage 1 uses
node:20-alpineto build theweb/default-profrontend; - Stage 2 uses
golang:1.22-alpine, builds the Go binary statically withCGO_ENABLED=0(the project uses the pure-Goglebarez/sqlite, so no CGO toolchain is needed), and auto-downloads thego.mod-declared 1.25 toolchain viaGOTOOLCHAIN=auto; - Stage 3 uses
alpine:latestas the runtime base, installing onlyca-certificates,tzdata, andwgetfor a small, secure footprint.
- Stage 1 uses
- Runs as non-root user
appby default, ships with an HTTP health check against/api/status, and declaresVOLUME [/app/config, /app/data]. - Default environment variables:
PORT=3000,LOG_DIR=/app/data/logs,SQLITE_PATH=/app/data/one-api-pro.db,CONFIG_DIR=/app/config.
Smart entrypoint (docker-entrypoint.sh)
- New
docker-entrypoint.shserves as the containerENTRYPOINTand provides three behaviors:- Auto-load
$CONFIG_DIR/.env: if the file exists at startup it is forwarded to one-api-pro as--env <path>, so users can mount a.envand have it take effect without touching thedocker runcommand; - CLI argument passthrough: arguments such as
docker run image --port 8080 --log-dir /xxxare forwarded verbatim to one-api-pro; - Debug passthrough: when the CMD's first argument is neither
one-api-pronor its absolute path (e.g.docker run image bash), the entrypointexecs the user-provided command directly so it is easy to drop into a shell.
- Auto-load
- Uses
execto replace the current process so that signals such asSIGTERMare correctly delivered to one-api-pro.
🔧 Tooling / CI
- Added
.github/workflows/release-docker.yml, decoupled from the existingrelease.yml(binary release):- Triggers:
pushof any tag matchingv*.*.*, or manualworkflow_dispatch(with optional tag input); - Enforces that
CHANGELOG/<tag>.mdexists, keeping the release process consistent withrelease.yml; - Enables multi-arch builds via
docker/setup-qemu-action+docker/setup-buildx-action, producinglinux/amd64andlinux/arm64images in parallel; - Uses
docker/metadata-actionto auto-generate semver tags (:0.0.10,:0.0,:0); thelatest=autoflavor skips pre-release suffixes (e.g.-rc,-beta); - Injects OCI metadata:
org.opencontainers.image.{title,description,source,licenses,revision,created}; - Enables GHA layer caching (
cache-from: type=gha/cache-to: type=gha,mode=max) so subsequent builds reuse cached layers in seconds; - Logs in to
ghcr.iodirectly with${{ secrets.GITHUB_TOKEN }}— no extra PAT needed; - After build/push, calls
gh apitoPATCHeither/users/{owner}/packages/container/{repo}or/orgs/{owner}/packages/container/{repo}to flip the package visibility topublic;continue-on-error: trueensures that a permission failure never blocks the image push.
- Triggers:
- Added
.dockerignore: aligned with.gitignoreto exclude.git,.github,node_modules,dist,logs,*.db, the deprecatedweb/air/web/berry/web/defaultthemes, and other build artifacts.
📚 Documentation
- Added a new "🐳 Docker 部署" section to
README.md, placed between "手动部署" and "多机部署", covering:- Image address reference (
latest/ pinned version / major); - Mount-point convention (
/app/configfor config,/app/datafor data); - Quick start (SQLite single-file) and
.envconfiguration example; - Switching to MySQL / PostgreSQL via
SQL_DSN, and three equivalent ways to change the listen port (-e/.env/ CLI arg); - A full CLI argument table (
--port,--log-dir,--env,--version,--help); - A complete
docker-compose.ymlexample, debug-mode entry, and upgrade workflow.
- Image address reference (
⚠️ Upgrade Notes
- This is a purely engineering / CI / documentation release — no backend code changes, no database migration, safe to upgrade.
- Existing binary users are completely unaffected: the binary deployment flow is unchanged.
- After the first Docker image is published, please verify on the GitHub repo's Packages page that the package is
public(the CI attempts this automatically; some organization repositories may require a maintainer to confirm). - docker-compose users should run
docker compose pull && docker compose up -dto pull the new image and restart.