- Clear default passwords in all service configs and local dev YAMLs
- Add entrypoint.sh with envsubst to resolve ${ENV} vars in go-zero YAML
- Update Dockerfiles to install gettext and use entrypoint
- Update docker-compose to pass secrets via environment and require via ${VAR:?...}
- Add .gitignore rules for .env files, add .env.example template
Co-Authored-By: Claude <noreply@anthropic.com>
22 lines
790 B
Docker
22 lines
790 B
Docker
ARG BASE_REGISTRY=harbor-in-k3s.cheverjohn.me/library
|
|
FROM ${BASE_REGISTRY}/golang:1.24-alpine AS builder
|
|
ENV GOPROXY=https://goproxy.cn,direct
|
|
RUN sed -i "s|dl-cdn.alpinelinux.org|mirrors.aliyun.com|g" /etc/apk/repositories
|
|
RUN apk add --no-cache git
|
|
WORKDIR /app
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /server ./rpc/system/system.go
|
|
|
|
FROM ${BASE_REGISTRY}/alpine:3.20
|
|
RUN sed -i "s|dl-cdn.alpinelinux.org|mirrors.aliyun.com|g" /etc/apk/repositories
|
|
RUN apk add --no-cache ca-certificates tzdata gettext
|
|
WORKDIR /app
|
|
COPY --from=builder /server ./system
|
|
COPY deploy/etc/system.yaml etc/system.yaml
|
|
COPY deploy/entrypoint.sh /entrypoint.sh
|
|
EXPOSE 9001
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
CMD ["./system", "-f", "etc/system.yaml"]
|