feat: add container CI/CD workflow

This commit is contained in:
2026-08-17 19:02:02 +08:00
parent b1b68d2754
commit 7216ffd60f
3 changed files with 37 additions and 2 deletions
+4 -2
View File
@@ -1,4 +1,4 @@
FROM node:24-alpine AS build
FROM node:24-alpine@sha256:d32cdf619f63fe0471182d08996dd516c6275bb5fd31ae06e55a570bd9e1ad43 AS build
WORKDIR /app
RUN corepack enable
@@ -9,7 +9,7 @@ RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
FROM caddy:2.10.2-alpine
FROM caddy:2.10.2-alpine@sha256:4c6e91c6ed0e2fa03efd5b44747b625fec79bc9cd06ac5235a779726618e530d
RUN apk add --no-cache jq nodejs
COPY Caddyfile /etc/caddy/Caddyfile
@@ -19,5 +19,7 @@ COPY --from=build /app/dist-server/edge-tts-server.cjs /usr/local/lib/tjwater-fr
RUN chmod 755 /usr/local/bin/tjwater-frontend-entrypoint
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget --quiet --spider http://127.0.0.1/ || exit 1
ENTRYPOINT ["/usr/local/bin/tjwater-frontend-entrypoint"]
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]