add cicd
This commit is contained in:
@@ -7,6 +7,10 @@ COPY . .
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||
CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/control-plane .
|
||||
|
||||
FROM build AS test
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build go test ./...
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build go vet ./...
|
||||
|
||||
FROM alpine:3.22
|
||||
RUN apk add --no-cache ca-certificates tzdata && \
|
||||
addgroup -S -g 65532 control && adduser -S -D -H -u 65532 -G control control
|
||||
@@ -14,4 +18,3 @@ COPY --from=build --chown=65532:65532 /out/control-plane /usr/local/bin/control-
|
||||
USER 65532:65532
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["/usr/local/bin/control-plane"]
|
||||
|
||||
|
||||
9
control-plane/docker-compose.prod.yml
Normal file
9
control-plane/docker-compose.prod.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
services:
|
||||
backend:
|
||||
image: ${CONTROL_PLANE_BACKEND_IMAGE:?CONTROL_PLANE_BACKEND_IMAGE is required}
|
||||
|
||||
frontend:
|
||||
image: ${CONTROL_PLANE_FRONTEND_IMAGE:?CONTROL_PLANE_FRONTEND_IMAGE is required}
|
||||
|
||||
grafana:
|
||||
image: ${CONTROL_PLANE_GRAFANA_IMAGE:?CONTROL_PLANE_GRAFANA_IMAGE is required}
|
||||
@@ -6,8 +6,12 @@ RUN --mount=type=cache,target=/root/.npm npm ci
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM build AS test
|
||||
RUN npm run lint
|
||||
RUN npm run typecheck
|
||||
RUN npm test -- --run
|
||||
|
||||
FROM nginxinc/nginx-unprivileged:1.27-alpine
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=build --chown=101:101 /app/dist /usr/share/nginx/html
|
||||
EXPOSE 8080
|
||||
|
||||
|
||||
Reference in New Issue
Block a user