diff --git a/Dockerfile b/Dockerfile old mode 100644 new mode 100755 index 00e1a67..3639e37 --- a/Dockerfile +++ b/Dockerfile @@ -6,5 +6,8 @@ RUN npm install COPY . . RUN npm run build -FROM nginxinc/nginx-unprivileged:stable-alpine -COPY --from=builder /app/dist /usr/share/nginx/html +#FROM nginxinc/nginx-unprivileged:stable-alpine +#COPY --from=builder /app/dist /usr/share/nginx/html + +FROM joseluisq/static-web-server:latest +COPY --from=builder /app/dist /public diff --git a/docker-compose.yaml b/docker-compose.yaml old mode 100644 new mode 100755 index c744143..cba69c2 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,6 +1,20 @@ +nanme: document services: document: image: ghcr.io/ranui/document:latest container_name: document ports: - - 8080:8080 + - 8080:80 + # 进阶配置 + # volumes: + # # 证书 + # - 证书路径:/ssl + # environment: + # # 账号 + # # 格式用户名:密码,必须使用BCrypt密码哈希函数对密码进行编码。 + # # 获取BCrypt加密的结果,把加密结果中的$替换成$$转义。 + # SERVER_BASIC_AUTH: "用户名:BCrypt加密密码" + # # 证书 + # SERVER_HTTP2_TLS: true + # SERVER_HTTP2_TLS_CERT: 证书路径 + # SERVER_HTTP2_TLS_KEY: 私钥路径 diff --git a/readme.md b/readme.md index 2387c6d..bfc9610 100644 --- a/readme.md +++ b/readme.md @@ -66,7 +66,7 @@ This project provides foundational services for document preview components in t ```bash # docker run -docker run -d --name document -p 8080:8080 ghcr.io/ranui/document:latest +docker run -d --name document -p 8080:80 ghcr.io/ranui/document:latest # docker compose services: @@ -74,7 +74,32 @@ services: image: ghcr.io/ranui/document:latest container_name: document ports: - - 8080:8080 + - 8080:80 +``` + +#### Advanced Configuration + +```yaml +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 ``` ### Important Notes diff --git a/readme.zh.md b/readme.zh.md index 4b86932..0afdba9 100644 --- a/readme.zh.md +++ b/readme.zh.md @@ -66,7 +66,7 @@ ```bash # docker run -docker run -d --name document -p 8080:8080 ghcr.io/ranui/document:latest +docker run -d --name document -p 8080:80 ghcr.io/ranui/document:latest # docker compose services: @@ -74,7 +74,32 @@ services: image: ghcr.io/ranui/document:latest container_name: document ports: - - 8080:8080 + - 8080:80 +``` + +#### 进阶配置 + +```yaml +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: 私钥路径 ``` ### 重要提示