2023-12-27 17:31:49 +09:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
|
2024-02-23 01:01:21 +09:00
|
|
|
FROM golang:alpine AS deps
|
|
|
|
RUN apk add --no-cache mariadb-dev sqlite-dev build-base
|
2023-12-27 17:31:49 +09:00
|
|
|
|
|
|
|
FROM deps AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
|
|
|
RUN cp configs/common.prod configs/common.go
|
|
|
|
RUN go mod download && go mod verify
|
|
|
|
RUN CGO_ENABLED=1 go build -v -o bootstrap cmd/main.go
|
|
|
|
|
|
|
|
FROM alpine:latest AS runner
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apk add --no-cache sqlite-libs mariadb-connector-c libgcc
|
|
|
|
COPY --from=builder /app/bootstrap .
|
|
|
|
|
2023-12-29 00:27:12 +09:00
|
|
|
EXPOSE 30303
|
|
|
|
ENV PORT 30303
|
2023-12-27 17:31:49 +09:00
|
|
|
|
|
|
|
CMD ["sh", "-c", "./bootstrap"]
|