Shioriko/Dockerfile

24 lines
576 B
Docker
Raw Normal View History

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 ./...
RUN CGO_ENABLED=0 GOOS=linux go build -o /shioriko -ldflags '-extldflags "-static"' -tags timetzdata
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-05 17:53:33 +00:00
RUN npm install && npm run build
2021-05-10 22:47:35 +07: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/
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"]