2026-01-30 15:03:58 +08:00
|
|
|
# syntax=docker/dockerfile:1
|
2026-04-11 12:21:33 +08:00
|
|
|
# Aether Gateway 运行时镜像(交叉编译方案)
|
|
|
|
|
# 二进制和前端产物均由 CI 预先构建,此 Dockerfile 仅做打包
|
|
|
|
|
# 用法: docker buildx build --platform linux/amd64,linux/arm64 -f Dockerfile.app .
|
|
|
|
|
#
|
|
|
|
|
# 构建上下文中须包含:
|
|
|
|
|
# dist/aether-gateway-amd64 (x86_64-unknown-linux-musl 交叉编译产物)
|
|
|
|
|
# dist/aether-gateway-arm64 (aarch64-unknown-linux-musl 交叉编译产物)
|
|
|
|
|
# dist/frontend/ (npm run build 产物)
|
2026-03-02 02:43:14 +08:00
|
|
|
|
2026-04-11 14:31:28 +08:00
|
|
|
FROM gcr.io/distroless/static-debian12
|
2026-03-02 02:43:14 +08:00
|
|
|
|
2026-04-11 12:21:33 +08:00
|
|
|
# TARGETARCH 由 buildx 自动注入: amd64 或 arm64
|
|
|
|
|
ARG TARGETARCH
|
2026-04-09 13:51:50 +08:00
|
|
|
|
2026-04-11 12:21:33 +08:00
|
|
|
COPY dist/aether-gateway-${TARGETARCH} /usr/local/bin/aether-gateway
|
|
|
|
|
COPY dist/frontend/ /srv/frontend
|
2026-04-09 13:51:50 +08:00
|
|
|
|
2026-04-03 16:26:16 +08:00
|
|
|
WORKDIR /app
|
|
|
|
|
|
2026-04-11 12:21:33 +08:00
|
|
|
ENV RUST_LOG=aether_gateway=info \
|
2026-04-11 17:39:02 +08:00
|
|
|
APP_PORT=8084 \
|
2026-04-03 16:26:16 +08:00
|
|
|
AETHER_GATEWAY_STATIC_DIR=/srv/frontend
|
|
|
|
|
|
2026-04-11 13:55:11 +08:00
|
|
|
EXPOSE 8084
|
2026-04-03 16:26:16 +08:00
|
|
|
|
2025-12-19 15:51:21 +08:00
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
2026-04-09 13:51:50 +08:00
|
|
|
CMD ["/usr/local/bin/aether-gateway", "--healthcheck"]
|
2026-04-03 16:26:16 +08:00
|
|
|
|
2026-04-11 15:07:44 +08:00
|
|
|
USER root
|
2026-04-03 16:26:16 +08:00
|
|
|
ENTRYPOINT ["/usr/local/bin/aether-gateway"]
|