ci: build and release webdrop-api and webdrop-files as separate images [CI]
- dev images are built only when the push touched code that image uses (path filters); webdrop-files does not wait for the frontend build - one v* tag releases both images (:tag and :latest) after the shared checks - registry build and push live in scripts/ci-publish-image.sh, used by every workflow - containers: fix the api Containerfile (missing Sync project), add Containerfile.files, Quadlet units for the file service (prod and dev), env examples, and registry auto-update for the production units so each machine pulls only the image it runs
This commit is contained in:
1 parent
5489407241
commit
8af4f284a0
13 files changed
+279
-71
No files matched your search
@@ -10,6 +10,7 @@ PublishPort=127.0.0.1:5001:5000
|
||||
Environment=ASPNETCORE_URLS=http://+:5000
|
||||
Environment=WebDrop__DataDir=/data
|
||||
Environment=DOTNET_EnableDiagnostics=0
|
||||
EnvironmentFile=-%h/podman/webdrop-dev/webdrop.env
|
||||
Volume=%h/podman/webdrop-dev/data:/data:Z,U
|
||||
ReadOnly=true
|
||||
ReadOnlyTmpfs=false
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
[Unit]
|
||||
Description=WebDrop file service (fileAPI) development environment from registry
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Container]
|
||||
ContainerName=webdrop-files-dev
|
||||
Image=registry.oeo.one/justme/webdrop-files:dev
|
||||
Pull=missing
|
||||
AutoUpdate=registry
|
||||
PublishPort=127.0.0.1:5101:5100
|
||||
Environment=ASPNETCORE_URLS=http://+:5100
|
||||
Environment=FileApi__DataDir=/data
|
||||
Environment=DOTNET_EnableDiagnostics=0
|
||||
EnvironmentFile=%h/podman/webdrop-files-dev/webdrop-files.env
|
||||
Volume=%h/podman/webdrop-files-dev/data:/data:Z,U
|
||||
ReadOnly=true
|
||||
ReadOnlyTmpfs=false
|
||||
Tmpfs=/tmp:rw,noexec,nosuid,size=16m
|
||||
DropCapability=ALL
|
||||
NoNewPrivileges=true
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
TimeoutStartSec=120
|
||||
TimeoutStopSec=60
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
@@ -0,0 +1,31 @@
|
||||
[Unit]
|
||||
Description=WebDrop file service (fileAPI)
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Container]
|
||||
ContainerName=webdrop-files
|
||||
# 正式环境:跟踪打 v* tag 发布的 latest。放文件的机器(例如家里的 NAS)只拉这个镜像,不需要主后端的
|
||||
Image=registry.oeo.one/justme/webdrop-files:latest
|
||||
Pull=missing
|
||||
AutoUpdate=registry
|
||||
PublishPort=127.0.0.1:5100:5100
|
||||
Environment=ASPNETCORE_URLS=http://+:5100
|
||||
Environment=FileApi__DataDir=/data
|
||||
Environment=DOTNET_EnableDiagnostics=0
|
||||
# 和主后端共用的密钥、允许的页面来源、备份设置等,不进仓库。例子见 webdrop-files.env.example
|
||||
EnvironmentFile=%h/podman/webdrop-files/webdrop-files.env
|
||||
Volume=%h/podman/webdrop-files/data:/data:Z,U
|
||||
ReadOnly=true
|
||||
ReadOnlyTmpfs=false
|
||||
Tmpfs=/tmp:rw,noexec,nosuid,size=16m
|
||||
DropCapability=ALL
|
||||
NoNewPrivileges=true
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
TimeoutStartSec=120
|
||||
TimeoutStopSec=60
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
@@ -0,0 +1,18 @@
|
||||
# 文件服务(家里的 NAS)的机器配置:复制到 ~/podman/webdrop-files/webdrop-files.env 并按实际情况修改。不要提交真实值
|
||||
# 和主后端共用的密钥,至少 32 个字符。两边必须一致
|
||||
FileApi__Secret=
|
||||
# 页面所在的源:浏览器直接把文件传到这里,必须列出,否则浏览器会拦下跨域请求
|
||||
FileApi__CorsOrigins__0=https://app.example.com
|
||||
# 创建频道时可选的文件空间档位(字节)和默认值;不配用内置的 1/5/10/50/100 GiB,默认 10 GiB
|
||||
# FileApi__QuotaChoices__0=1073741824
|
||||
# FileApi__QuotaChoices__1=10737418240
|
||||
# FileApi__DefaultQuota=10737418240
|
||||
# 文件服务最多存多少字节,0 为不限
|
||||
# FileApi__MaxStoreBytes=0
|
||||
# 每天把新增的文件备份到 S3 协议的存储
|
||||
# FileApi__Backup__Enabled=true
|
||||
# FileApi__Backup__Time=04:30
|
||||
# FileApi__Backup__S3__Endpoint=https://s3.example.com
|
||||
# FileApi__Backup__S3__Bucket=webdrop
|
||||
# FileApi__Backup__S3__AccessKey=
|
||||
# FileApi__Backup__S3__SecretKey=
|
||||
@@ -1,15 +1,21 @@
|
||||
[Unit]
|
||||
Description=WebDrop API with embedded frontend
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Container]
|
||||
ContainerName=webdrop
|
||||
Image=localhost/webdrop:local
|
||||
Pull=never
|
||||
# 正式环境:跟踪打 v* tag 发布的 latest。podman-auto-update.timer 每隔几分钟检查 registry,有新镜像就拉取并重启这个单元
|
||||
Image=registry.oeo.one/justme/webdrop-api:latest
|
||||
Pull=missing
|
||||
AutoUpdate=registry
|
||||
PublishPort=127.0.0.1:5000:5000
|
||||
Environment=ASPNETCORE_URLS=http://+:5000
|
||||
Environment=WebDrop__DataDir=/data
|
||||
Environment=DOTNET_EnableDiagnostics=0
|
||||
Volume=/home/justme/podman/webdrop/data:/data:Z,U
|
||||
# 机器上的配置(文件服务的地址和共用密钥等),不进仓库。例子见 webdrop.env.example
|
||||
EnvironmentFile=-%h/podman/webdrop/webdrop.env
|
||||
Volume=%h/podman/webdrop/data:/data:Z,U
|
||||
ReadOnly=true
|
||||
ReadOnlyTmpfs=false
|
||||
Tmpfs=/tmp:rw,noexec,nosuid,size=16m
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# 主后端(VPS)的机器配置:复制到 ~/podman/webdrop/webdrop.env 并按实际情况修改。不要提交真实值
|
||||
# 打开文件服务:文件内容不放主后端,由 fileAPI 保存;主后端只签发访问票据
|
||||
WebDrop__Files__Enabled=true
|
||||
# 浏览器访问文件服务的地址(必须 https,和文件服务机器上配的对外地址一致)
|
||||
WebDrop__Files__PublicUrl=https://files.example.com
|
||||
# 和文件服务共用的密钥,至少 32 个字符:openssl rand -base64 48。两边必须一致
|
||||
WebDrop__Files__Secret=
|
||||
Reference in new issue
Block a user