chore: update nginx config, add oneapi, verification pages and codebuddy skills
This commit is contained in:
37
.codebuddy/skills/docker-build/SKILL.md
Normal file
37
.codebuddy/skills/docker-build/SKILL.md
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
name: docker-build
|
||||
description: 根据dockerfile构建镜像
|
||||
---
|
||||
|
||||
# Docker Build
|
||||
|
||||
## Overview
|
||||
|
||||
此技能用于协助完成 Docker 镜像的构建
|
||||
|
||||
## When to Use
|
||||
|
||||
根据docker file 构建镜像
|
||||
|
||||
## Core Workflow
|
||||
|
||||
### 1. 清理node1 服务器 ~/dockerbuild/ 目录下,对应项目的文件
|
||||
|
||||
|
||||
|
||||
### 2. 同步代码到node1 服务器 ~/dockerbuild/ 目录下,对应项目的文件
|
||||
|
||||
|
||||
|
||||
### 3. 执行docker build 构建镜像
|
||||
|
||||
### 4. 导出镜像,并下载到当前项目对应的把目录下
|
||||
|
||||
## node1服务器信息
|
||||
ip 10.0.3.5
|
||||
用户名 awei
|
||||
已做ssh 互信
|
||||
## 镜像命名
|
||||
- 名字保持和对应目录名称一致
|
||||
- 版本采用月日时分格式,如 04192334(4月19日23时34分)
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
# MEMORY.md
|
||||
|
||||
## 服务器信息
|
||||
|
||||
### node1
|
||||
- **IP**: 10.0.3.5
|
||||
- **用户名**: awei
|
||||
- **SSH 互信**: 已配置
|
||||
|
||||
## Docker 镜像构建流程
|
||||
|
||||
### 关键步骤
|
||||
|
||||
1. **清理服务端目录**(避免文件残留导致问题)
|
||||
```bash
|
||||
ssh awei@10.0.3.5 "rm -rf /tmp/<目录名> && mkdir -p /tmp/<目录名>"
|
||||
```
|
||||
|
||||
2. **上传源码文件**
|
||||
```bash
|
||||
scp <本地文件> awei@10.0.3.5:/tmp/<目录名>/
|
||||
```
|
||||
|
||||
3. **构建镜像**(带版本号)
|
||||
```bash
|
||||
ssh awei@10.0.3.5 "cd /tmp/<目录名> && docker build -t stonelan/<镜像名>:YYYYMMDD -t stonelan/<镜像名>:latest ."
|
||||
```
|
||||
|
||||
4. **导出镜像**
|
||||
```bash
|
||||
ssh awei@10.0.3.5 "docker save -o /tmp/<镜像名>-YYYYMMDD.tar stonelan/<镜像名>:YYYYMMDD"
|
||||
```
|
||||
|
||||
5. **下载到本地**
|
||||
```bash
|
||||
scp awei@10.0.3.5:/tmp/<镜像名>-YYYYMMDD.tar <本地路径>/
|
||||
```
|
||||
|
||||
### 现有镜像
|
||||
|
||||
| 镜像名称 | 版本号 | 基础镜像 | 说明 |
|
||||
|---------|--------|---------|------|
|
||||
| stonelan/nginx | 1.0.1 | nginx:alpine | 反向代理,含自定义配置 |
|
||||
| stonelan/frpc | 1.0.1 | alpine:3.19 | FRP 客户端 v0.61.1 |
|
||||
|
||||
### 注意事项
|
||||
|
||||
- **版本号格式**:语义化版本 `X.Y.Z`(如 1.0.0、1.0.1、1.1.0)
|
||||
- **每次构建必须递增版本号**,避免重复
|
||||
- 构建前先清理服务端临时目录,避免旧文件干扰
|
||||
- 本地 tar.gz 等二进制文件通过 scp 传输正常,无需特殊处理
|
||||
|
||||
### 已知问题
|
||||
|
||||
- **scp 传输速度慢**:Windows OpenSSH 客户端传输速度约 0.76 MB/s(12MB 文件需 2-3 分钟),暂无解决方案
|
||||
@@ -10,6 +10,9 @@ LABEL description="Nginx reverse proxy container"
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY conf.d /etc/nginx/conf.d
|
||||
|
||||
# 复制静态文件
|
||||
COPY html /usr/share/nginx/html
|
||||
|
||||
# 创建必要的目录
|
||||
RUN mkdir -p /var/log/nginx && \
|
||||
mkdir -p /etc/nginx/ssl && \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name gitea.membank.xyz;
|
||||
server_name gitea.stonelan.cn;
|
||||
client_max_body_size 200m;
|
||||
location / {
|
||||
proxy_pass http://gitea:3000;
|
||||
|
||||
11
nginx/conf.d/membank-xyz.conf
Normal file
11
nginx/conf.d/membank-xyz.conf
Normal file
@@ -0,0 +1,11 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name membank.xyz;
|
||||
|
||||
root /usr/share/nginx/html/membank;
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
}
|
||||
38
nginx/conf.d/oneapi.conf
Normal file
38
nginx/conf.d/oneapi.conf
Normal file
@@ -0,0 +1,38 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name oneapi.membank.xyz;
|
||||
|
||||
location / {
|
||||
proxy_pass http://oneapi:3000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
# 添加代理超时配置
|
||||
proxy_connect_timeout 60s;
|
||||
proxy_read_timeout 600s;
|
||||
proxy_send_timeout 600s;
|
||||
|
||||
# 支持大文件上传和API请求
|
||||
client_max_body_size 100M;
|
||||
proxy_buffering off;
|
||||
|
||||
# 启用gzip压缩
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_min_length 1024;
|
||||
gzip_proxied any;
|
||||
gzip_comp_level 6;
|
||||
gzip_types
|
||||
text/plain
|
||||
text/css
|
||||
text/xml
|
||||
text/javascript
|
||||
application/json
|
||||
application/javascript
|
||||
application/xml+rss
|
||||
application/atom+xml
|
||||
image/svg+xml;
|
||||
}
|
||||
}
|
||||
21
nginx/conf.d/sy.conf
Normal file
21
nginx/conf.d/sy.conf
Normal file
@@ -0,0 +1,21 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name sy.membank.xyz;
|
||||
|
||||
location / {
|
||||
proxy_pass http://10.0.3.148:6806;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
# WebSocket 支持
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
# 添加代理超时配置
|
||||
proxy_connect_timeout 60s;
|
||||
proxy_read_timeout 600s;
|
||||
proxy_send_timeout 600s;
|
||||
}
|
||||
}
|
||||
18
nginx/conf.d/v.conf
Normal file
18
nginx/conf.d/v.conf
Normal file
@@ -0,0 +1,18 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name v.membank.xyz;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html/v;
|
||||
index index.html index.htm;
|
||||
|
||||
# 启用目录浏览(可选)
|
||||
autoindex on;
|
||||
|
||||
# 添加缓存配置
|
||||
location ~* \.(html|css|js|png|jpg|jpeg|gif|ico|svg)$ {
|
||||
expires 1d;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
}
|
||||
}
|
||||
1
nginx/html/membank/verification.html
Normal file
1
nginx/html/membank/verification.html
Normal file
@@ -0,0 +1 @@
|
||||
verify_01965aad87b3aae1c15f4373ae9efcfb
|
||||
1
nginx/html/v/verification.html
Normal file
1
nginx/html/v/verification.html
Normal file
@@ -0,0 +1 @@
|
||||
verify_01965aad87b3aae1c15f4373ae9efcfb
|
||||
BIN
nginx/nginx-08200145.tar
Normal file
BIN
nginx/nginx-08200145.tar
Normal file
Binary file not shown.
BIN
nginx/nginx.tar
Normal file
BIN
nginx/nginx.tar
Normal file
Binary file not shown.
1
nginx/verification.html
Normal file
1
nginx/verification.html
Normal file
@@ -0,0 +1 @@
|
||||
verify_01965aad87b3aae1c15f4373ae9efcfb
|
||||
62
oneapi/docker-compose.yml
Normal file
62
oneapi/docker-compose.yml
Normal file
@@ -0,0 +1,62 @@
|
||||
services:
|
||||
mysql:
|
||||
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/mysql:8.0
|
||||
container_name: mysql
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- MYSQL_ROOT_PASSWORD=oneapi_root_pass
|
||||
- MYSQL_DATABASE=oneapi
|
||||
- MYSQL_USER=oneapi
|
||||
- MYSQL_PASSWORD=oneapi_pass
|
||||
restart: always
|
||||
volumes:
|
||||
- ./mysql/data:/var/lib/mysql
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "3307:3306"
|
||||
networks:
|
||||
- trim-default
|
||||
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
||||
|
||||
redis:
|
||||
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/redis:7-alpine
|
||||
container_name: redis
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
restart: always
|
||||
volumes:
|
||||
- ./redis/data:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "6380:6379"
|
||||
networks:
|
||||
- trim-default
|
||||
command: redis-server --appendonly yes
|
||||
|
||||
oneapi:
|
||||
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/ghcr.io/songquanpeng/one-api:v0.6.7
|
||||
container_name: oneapi
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- SESSION_SECRET=change_this_to_your_secret_key
|
||||
- SQL_DSN=oneapi:oneapi_pass@tcp(mysql:3306)/oneapi?charset=utf8mb4&parseTime=true
|
||||
- REDIS_CONN_STRING=redis://redis:6379/0
|
||||
- MEMORY_CACHE=1
|
||||
restart: always
|
||||
volumes:
|
||||
- ./data:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "3003:3000"
|
||||
networks:
|
||||
- trim-default
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
||||
|
||||
networks:
|
||||
trim-default:
|
||||
external: true
|
||||
Reference in New Issue
Block a user