mirror of
https://github.com/simon-ding/polaris.git
synced 2026-03-03 16:10:45 +08:00
- Docker images support amd64 and arm64 architectures - The web interface is built using github actions - Use Alpine as the base image to compress the image size
24 lines
365 B
Docker
24 lines
365 B
Docker
FROM golang:1.22-alpine3.20 as builder
|
|
|
|
# 启用go module
|
|
ENV GO111MODULE=on \
|
|
GOPROXY=https://goproxy.cn,direct
|
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
RUN go build -o polaris ./cmd/
|
|
|
|
FROM alpine:3.20
|
|
|
|
WORKDIR /app
|
|
RUN apk add --no-cache bash ca-certificates
|
|
|
|
COPY --from=builder /app/polaris .
|
|
|
|
EXPOSE 8080
|
|
|
|
ENTRYPOINT ["./polaris"] |