feat(06): live deploy to zijingmoments.xyz (nginx+HTTPS, docker compose networking) - #166
Open
sililass wants to merge 1 commit into
Open
feat(06): live deploy to zijingmoments.xyz (nginx+HTTPS, docker compose networking)#166sililass wants to merge 1 commit into
sililass wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
2025暑培-网站作业提交
作业内容(第 6 讲 Deployment)
将便签纸全栈应用部署到公网 https://zijingmoments.xyz(阿里云轻量应用服务器 182.92.245.68),并配置 HTTPS:
80:80端口映射用于 HTTP→HTTPS 跳转;接入backend_default与database_default两个外部网络,使 nginx 可同时反代 backend 与 graphql-engineserver_name zijingmoments.xyz;80 端口统一return 301 https://$host$request_uri;443 使用 Let's Encrypt 证书(nginx 挂载宿主机 /etc/letsencrypt),/→ backend:8888(保留 Host 头、client_max_body_size 100M),/v1/graphql→ graphql-engine:8080(保留 WebSocket upgrade 头)backend:latest镜像,映射 20248:8888,加入database_default外部网络,endpoint 直连http://graphql-engine:8080/v1/graphqlyarn install步骤前追加 npmmirror 源配置(registry.npmmirror.com),解决服务器构建时官方源不可达导致的安装失败@types/express与@types/multer类型冲突导致tsc编译失败的两处类型问题server/database/docker-compose.yml(postgres:15 + hasura/graphql-engine:v2.40.0,映射 20247),建表 SQL 与 Hasura metadata 来自database/目录改动文件(相对 06-Deployment,共 5 个):新增
server/nginx/nginx.conf、server/backend/docker-compose.yml;修改server/nginx/docker-compose.yml、backend/Dockerfile、backend/src/file.ts。验收结果(2026-09-04 实测)
https://zijingmoments.xyz/user/login:正确密码返回 200,错误密码返回 401(多次复测)ssl_verify_result: 0),Let's Encrypt 签发,有效期至 2026-12-03(宿主机 certbot + timer 自动续期)https://zijingmoments.xyz/v1/graphql:admin + GraphQL 查询返回 200http://182.92.245.68:20247/healthz返回 200(healthy)http://127.0.0.1/返回 301http://zijingmoments.xyz时阿里云边缘返回 403 "Non-compliance ICP Filing"(域名未完成 ICP 备案,机房侧对 80 明文端口的拦截,不影响 HTTPS)基本信息
提交说明
workshop: https://zijingmoments.xyz),并关联第6讲作业提交通道(Deployment) 第6讲作业提交通道(Deployment) #9