Files
sso/docker-compose.yml
T
admin 67a8e731cc feat(deploy): 容器化构建(多阶段 Dockerfile + compose + entrypoint + 共用 base)
- 主镜像 Dockerfile:多阶段构建,复用 rust-nginx-base 镜像(nginx 1.30.4 + rust 1.89
  + 已 configure 的 pcre/openssl/编译链),冷构建从 ~17min 压到 ~5min
- deploy/nginx.conf:容器内 nginx 配置(端口 18098 / /usr/local/nginx/... 路径)
- docker-compose.yml:本机一键起服务(端口 8881→18098)+ S10 健康探测
- scripts/container-entrypoint.sh:容器入口脚本(启动前 healthcheck 等)
- .dockerignore:避免把 build/target/data/refs 误打进镜像
- deploy/Dockerfile.base:rust-nginx-base 镜像定义(apt 链 + nginx/pcre 源码 + 已
  ./configure 过的源码树)
- deploy/build-base-image.sh:构建并推送 base 镜像到阿里云 CR
  (crpi-yscq976uwza88qap.cn-shenzhen.personal.cr.aliyuncs.com/ssw188/nginx)
2026-09-24 16:27:05 +08:00

40 lines
1.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ipass-sso 本地部署(端口 8881)
#
# 前置:
# cd ../ipass-sso && git submodule update --init
# docker build \
# --build-context ngxbuild=../ipass/build/ngxbuild \
# -t ipass-sso:dev .
#
# 启动:
# docker compose up -d
#
# 数据持久化在宿主机 ./data(相对 docker-compose.yml),容器随便删重建,状态不丢。
# 升级镜像:
# docker build ... && docker compose up -d --force-recreate
#
# chg_0012 S10 健康探测:
# curl -fs http://127.0.0.1:8881/.well-known/openid-configuration
services:
sso:
build:
context: .
dockerfile: Dockerfile
additional_contexts:
- ngxbuild=../ipass/build/ngxbuild
image: ipass-sso:dev
container_name: ipass-sso
ports:
# 宿主 8881 → 容器 18098(OAUTH_ISSUER=http://127.0.0.1:18098)
- "8881:18098"
environment:
- ADMIN_USER=${ADMIN_USER:-admin}
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-123456}
- ALICE_PASSWORD=${ALICE_PASSWORD:-alice123}
- OAUTH_ISSUER=${OAUTH_ISSUER:-http://127.0.0.1:18098}
- OAUTH_SIGNING_SECRET=${OAUTH_SIGNING_SECRET:-}
- OAUTH_COOKIE_DOMAIN=${OAUTH_COOKIE_DOMAIN:-}
volumes:
- ./data:/usr/local/nginx/data
restart: unless-stopped