1
0
mirror of https://github.com/Bluemangoo/sekai-unpacker.git synced 2026-05-06 20:44:47 +08:00

dockerfile, modify it when using

This commit is contained in:
Bluemangoo 2026-04-23 19:42:09 +08:00
parent e00b25b6c7
commit e019948017
Signed by: Bluemangoo
GPG Key ID: F2F7E46880A1C4CF
4 changed files with 87 additions and 1 deletions

20
.dockerignore Normal file
View File

@ -0,0 +1,20 @@
# Git files
.git
.gitignore
# Build artifacts
target/
# Logs
logs/
*.log
# Data
data/
# IDE
.idea/
.vscode/
*.swp
*.swo
*~

20
client.DOCKERFILE Normal file
View File

@ -0,0 +1,20 @@
FROM rust:slim-bookworm AS builder
WORKDIR /usr/src/app
RUN apt-get update && apt-get install -y musl-tools pkg-config libssl-dev
RUN rustup target add x86_64-unknown-linux-musl
COPY . .
RUN cargo build --target x86_64-unknown-linux-musl --release --bin client
FROM alpine:latest
RUN apk add --no-cache ca-certificates
RUN update-ca-certificates
WORKDIR /app
COPY --from=builder /usr/src/app/target/x86_64-unknown-linux-musl/release/client .
# Copy config file
COPY sekai-unpacker-client.yaml .
CMD ["./client", "-p", "cn", "-p", "jp"]
EXPOSE 3000

View File

@ -51,7 +51,7 @@ profiles:
region: cn region: cn
# ========== 版本信息配置(可选) ========== # ========== 版本信息配置(可选) ==========
# 以下三个字段如果设置,则覆盖 dynamic_load 中的值 # 以下三个字段会被 dynamic_load 中的值覆盖
# 应用版本 # 应用版本
# app_version: "6.0.0" # app_version: "6.0.0"
@ -72,6 +72,7 @@ profiles:
app_version: appVersion app_version: appVersion
asset_version: assetVersion asset_version: assetVersion
asset_hash: assetHash asset_hash: assetHash
# concurrent: concurrent # [可选] 远程并发数,需为数字
# ========== 下载配置 ========== # ========== 下载配置 ==========
# 更新间隔(秒,可选) # 更新间隔(秒,可选)
@ -167,8 +168,10 @@ profiles:
dynamic_load: dynamic_load:
url: "https://github.com/Team-Haruki/haruki-sekai-master/raw/refs/heads/main/versions/current_version.json" url: "https://github.com/Team-Haruki/haruki-sekai-master/raw/refs/heads/main/versions/current_version.json"
map: map:
# app_version: appVersion
asset_version: assetVersion asset_version: assetVersion
asset_hash: assetHash asset_hash: assetHash
# concurrent: concurrent # [可选] 远程并发数,需为数字
# 过滤配置 # 过滤配置
filters: filters:

43
server.DOCKERFILE Normal file
View File

@ -0,0 +1,43 @@
FROM rust:slim-bookworm AS builder
WORKDIR /usr/src/app
RUN cargo build --release
RUN apt-get update && apt-get install -y musl-tools pkg-config libssl-dev
RUN rustup target add x86_64-unknown-linux-musl
COPY . .
RUN cargo build --target x86_64-unknown-linux-musl --release --bin client
FROM mcr.microsoft.com/dotnet/sdk:9.0-bookworm-slim AS assetstudio-builder
WORKDIR /src
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates && \
rm -rf /var/lib/apt/lists/*
RUN git clone --depth 1 --single-branch --branch sekai-modify https://github.com/Team-Haruki/AssetStudio.git
RUN cd AssetStudio/AssetStudioCLI && \
dotnet publish -c Release -r linux-x64 -f net9.0 --self-contained true -o /app/assetstudio \
-p:PublishTrimmed=false \
-p:PublishSingleFile=true \
-p:IncludeNativeLibrariesForSelfExtract=true
FROM mwader/static-ffmpeg:7.1.1 AS ffmpeg-builder
FROM debian:trixie-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
tzdata \
libicu76 \
libxml2 && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /app/target/release/server /app/server
COPY --from=assetstudio-builder /app/assetstudio /app/server
COPY --from=ffmpeg-builder /ffmpeg /usr/local/bin/ffmpeg
RUN ln -sf /app/assetstudio/AssetStudioModCLI /app/assetstudio/AssetStudioCLI && \
mkdir -p logs
ENV TZ=Asia/Shanghai \
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
EXPOSE 3000
CMD ["./server"]