iop/apps/control-plane/Dockerfile
toki ed882cf6a4 feat: add control-plane, web, and docker-compose
- Add control-plane service with Dockerfile and internal packages
- Add web application (Next.js)
- Add docker-compose.yml for orchestration
- Update .gitignore and README.md
2026-05-18 06:21:48 +09:00

29 lines
849 B
Docker

# syntax=docker/dockerfile:1
FROM golang:1.24-alpine AS builder
WORKDIR /workspace/go-iop
RUN apk add --no-cache git
# docker-compose builds this Dockerfile with /config/workspace as context so
# the local ../proto-socket/go replace in go.mod is available.
COPY go-iop/go.mod go-iop/go.sum ./
COPY proto-socket/go /workspace/proto-socket/go
RUN go mod download
COPY go-iop/ ./
RUN CGO_ENABLED=0 GOFLAGS=-trimpath go build -o /out/control-plane ./apps/control-plane/cmd/control-plane
FROM alpine:3.22
RUN addgroup -S iop && adduser -S iop -G iop
WORKDIR /app
COPY --from=builder /out/control-plane /usr/local/bin/control-plane
COPY --from=builder /workspace/go-iop/configs/control-plane.yaml /app/configs/control-plane.yaml
EXPOSE 9080 19080
USER iop
ENTRYPOINT ["control-plane"]
CMD ["serve", "--config", "/app/configs/control-plane.yaml"]