2025-02-05 17:35:53 +00:00
|
|
|
FROM golang:1.23-alpine AS build
|
2021-05-09 22:07:23 +07:00
|
|
|
|
|
|
|
WORKDIR /go/src/shioriko
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN go get -d -v ./...
|
2025-02-05 18:26:47 +00:00
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -o /shioriko -ldflags '-extldflags "-static"' -tags timetzdata
|
2023-08-09 00:26:37 +07:00
|
|
|
RUN mkdir -p /web && cp -r web/static /web
|
2021-05-09 22:07:23 +07:00
|
|
|
|
2025-02-05 17:53:33 +00:00
|
|
|
FROM node:20-alpine AS node_build
|
2021-05-10 22:47:35 +07:00
|
|
|
WORKDIR /src
|
|
|
|
COPY . .
|
|
|
|
WORKDIR /src/web/app
|
2025-02-22 16:10:23 +00:00
|
|
|
RUN npm ci && npm run build
|
2021-05-10 22:47:35 +07:00
|
|
|
|
2025-02-05 18:26:47 +00:00
|
|
|
FROM scratch AS runtime
|
2021-05-10 09:45:40 +07:00
|
|
|
|
2021-05-10 22:47:35 +07:00
|
|
|
WORKDIR /app
|
2021-05-11 17:33:22 +07:00
|
|
|
COPY --from=build /shioriko /app/
|
2025-02-05 18:26:47 +00:00
|
|
|
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
2021-05-11 17:33:22 +07:00
|
|
|
COPY --from=node_build /src/web/static/ /app/web/static/
|
2021-05-09 22:07:23 +07:00
|
|
|
|
2021-05-10 22:47:35 +07:00
|
|
|
ENTRYPOINT ["/app/shioriko"]
|