Skip to content

Conversation

@Firfr
Copy link
Contributor

@Firfr Firfr commented Dec 21, 2025

容器基础镜像更换为 static-web-server
支持通过环境变量为应用设置账号密码和配置ssl证书
方便使用。
The container's base image has been changed to static-web-server.

Supports setting application username/password and SSL certificate via environment variables,

making it easy to use.

nanme: document
services:
  document:
    image: ghcr.io/ranui/document:latest
    container_name: document
    ports:
      - 8080:80
    # 进阶配置
    volumes:
      # 添加证书
      - 证书路径:/ssl
    environment:
      # 设置账号
      # 格式用户名:密码,必须使用BCrypt密码哈希函数对密码进行编码。
      # 获取BCrypt加密的结果,把加密结果中的$替换成$$转义。
      SERVER_BASIC_AUTH: "用户名:BCrypt加密密码"
      # 使用证书
      SERVER_HTTP2_TLS: true
      SERVER_HTTP2_TLS_CERT: 证书路径
      SERVER_HTTP2_TLS_KEY: 私钥路径
nanme: document
services:
  document:
    image: ghcr.io/ranui/document:latest
    container_name: document
    ports:
      - 8080:80
    # Advanced Configuration
    volumes:
      # Add certificates
      - certificate_path:/ssl
    environment:
      # Set account
      # Format username:password, password must be encoded using BCrypt hash function.
      # To get BCrypt encryption result, replace $ in the encrypted result with $$ for escaping.
      SERVER_BASIC_AUTH: "username:BCrypt_encrypted_password"
      # Use certificate
      SERVER_HTTP2_TLS: true
      SERVER_HTTP2_TLS_CERT: certificate_path
      SERVER_HTTP2_TLS_KEY: private_key_path

#51

@chaxus chaxus merged commit f6e1007 into ranuts:main Dec 22, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants