mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-18 16:07:10 +00:00
25 lines
402 B
Docker
25 lines
402 B
Docker
|
|
# --- Build Stage ---
|
||
|
|
FROM golang:1.21-alpine AS builder
|
||
|
|
|
||
|
|
WORKDIR /app
|
||
|
|
|
||
|
|
ENV GO111MODULE=on
|
||
|
|
|
||
|
|
COPY go.mod go.sum ./
|
||
|
|
RUN go mod download
|
||
|
|
|
||
|
|
COPY . .
|
||
|
|
|
||
|
|
RUN go build -o app .
|
||
|
|
|
||
|
|
# --- Run Stage ---
|
||
|
|
FROM alpine:latest
|
||
|
|
|
||
|
|
RUN apk --no-cache add ca-certificates
|
||
|
|
|
||
|
|
WORKDIR /root/
|
||
|
|
|
||
|
|
COPY --from=builder /app/app .
|
||
|
|
|
||
|
|
CMD ["./app"]
|
||
|
|
|