2026-01-30 15:03:58 +08:00
|
|
|
# syntax=docker/dockerfile:1
|
2026-05-22 15:15:17 +08:00
|
|
|
# Aether Gateway runtime image (cross-compilation)
|
|
|
|
|
# Binary and frontend assets are pre-built by CI; this Dockerfile only packages them.
|
|
|
|
|
# Usage: docker buildx build --platform linux/amd64,linux/arm64 -f Dockerfile.app .
|
2026-04-11 12:21:33 +08:00
|
|
|
#
|
2026-05-22 15:15:17 +08:00
|
|
|
# Build context must contain:
|
|
|
|
|
# dist/aether-gateway-amd64 (x86_64-unknown-linux-musl cross-compiled binary)
|
|
|
|
|
# dist/aether-gateway-arm64 (aarch64-unknown-linux-musl cross-compiled binary)
|
|
|
|
|
# dist/frontend/ (npm run build output)
|
2026-03-02 02:43:14 +08:00
|
|
|
|
2026-05-22 15:15:17 +08:00
|
|
|
# --- layout stage: create /opt/aether directory structure with symlink ---
|
|
|
|
|
# distroless has no shell, so we use busybox to set up the symlink.
|
|
|
|
|
FROM busybox:1.37-musl AS layout
|
2026-03-02 02:43:14 +08:00
|
|
|
|
2026-04-11 12:21:33 +08:00
|
|
|
ARG TARGETARCH
|
2026-04-09 13:51:50 +08:00
|
|
|
|
2026-05-22 15:15:17 +08:00
|
|
|
RUN mkdir -p /opt/aether/releases/image/bin /opt/aether/releases/image/frontend /opt/aether/logs
|
2026-05-20 22:02:47 +08:00
|
|
|
|
2026-05-22 15:15:17 +08:00
|
|
|
COPY dist/aether-gateway-${TARGETARCH} /opt/aether/releases/image/bin/aether-gateway
|
|
|
|
|
RUN chmod 0755 /opt/aether/releases/image/bin/aether-gateway
|
|
|
|
|
COPY dist/frontend/ /opt/aether/releases/image/frontend/
|
2026-04-09 13:51:50 +08:00
|
|
|
|
2026-05-22 15:15:17 +08:00
|
|
|
RUN ln -s /opt/aether/releases/image /opt/aether/current
|
|
|
|
|
|
|
|
|
|
# --- final stage: distroless runtime ---
|
|
|
|
|
FROM gcr.io/distroless/static-debian12
|
|
|
|
|
|
2026-05-24 18:47:33 +08:00
|
|
|
COPY --from=layout /opt/aether /opt/aether
|
2026-05-22 15:15:17 +08:00
|
|
|
|
|
|
|
|
WORKDIR /opt/aether
|
2026-04-03 16:26:16 +08:00
|
|
|
|
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-05-23 20:14:26 +08:00
|
|
|
AETHER_UPDATE_STRATEGY=docker \
|
2026-05-22 15:15:17 +08:00
|
|
|
AETHER_GATEWAY_STATIC_DIR=/opt/aether/current/frontend
|
2026-04-03 16:26:16 +08:00
|
|
|
|
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-05-22 15:15:17 +08:00
|
|
|
CMD ["/opt/aether/current/bin/aether-gateway", "--healthcheck"]
|
2026-04-03 16:26:16 +08:00
|
|
|
|
2026-05-24 18:47:33 +08:00
|
|
|
USER root
|
2026-05-22 15:15:17 +08:00
|
|
|
ENTRYPOINT ["/opt/aether/current/bin/aether-gateway"]
|