diff --git a/.github/workflows/containers.yaml b/.github/workflows/containers.yaml index 53bcc88..a35624c 100644 --- a/.github/workflows/containers.yaml +++ b/.github/workflows/containers.yaml @@ -22,6 +22,7 @@ jobs: # MONDOO_SERVICE_ACCOUNT: "${{ fromJson(secrets.VAULT_KV_1D187965_OP_MONDOO_PACKER_AGENT).password }}" with: dockerfile: "${{ matrix.container }}/Dockerfile" + image_name: "${{ github.repository }}/${{matrix.container}}" score: 50 platforms: "linux/amd64, linux/arm64" release: false diff --git a/go/Dockerfile b/go/Dockerfile index 888ea25..c6e374a 100644 --- a/go/Dockerfile +++ b/go/Dockerfile @@ -1,6 +1,6 @@ #first stage - building golang artifact -FROM golang:1.20.12-alpine as builder +FROM golang:1.20.12-alpine AS builder WORKDIR /src COPY . . RUN go mod download @@ -8,6 +8,9 @@ RUN CGO_ENABLED=0 go build -o app . # output container ... FROM debian:buster-slim + COPY --from=builder /src/app /bin/app + EXPOSE 6000 + CMD ["/bin/app"] \ No newline at end of file diff --git a/kubernetes/go-events.yaml b/kubernetes/go-events.yaml index 237fa81..7df93cb 100644 --- a/kubernetes/go-events.yaml +++ b/kubernetes/go-events.yaml @@ -31,7 +31,7 @@ spec: spec: containers: - name: go-events - image: mati007thm/dapr-distributed-calendar_go-events:manual + image: ghcr.io/infralovers/12-factor-app-go env: - name: APP_PORT value: "6000" diff --git a/kubernetes/node-controller.yaml b/kubernetes/node-controller.yaml index 473a215..5a0fbfc 100644 --- a/kubernetes/node-controller.yaml +++ b/kubernetes/node-controller.yaml @@ -48,7 +48,7 @@ spec: spec: containers: - name: controller - image: mati007thm/dapr-distributed-calendar_controller:manual + image: ghcr.io/infralovers/12-factor-app-node env: - name: APP_PORT value: "3000" diff --git a/kubernetes/python-messages.yaml b/kubernetes/python-messages.yaml index bf2e483..7964523 100644 --- a/kubernetes/python-messages.yaml +++ b/kubernetes/python-messages.yaml @@ -30,7 +30,7 @@ spec: spec: containers: - name: messages - image: mati007thm/dapr-distributed-calendar_messages:manual + image: ghcr.io/infralovers/12-factor-app-python env: - name: "APP_PORT" value: "5000" diff --git a/node/Dockerfile b/node/Dockerfile index 2459998..a5cb07d 100644 --- a/node/Dockerfile +++ b/node/Dockerfile @@ -5,4 +5,5 @@ COPY . . RUN npm install EXPOSE 3000 + CMD [ "node", "--require", "./instrumentation.js", "node_controller.js"] \ No newline at end of file diff --git a/python/Dockerfile b/python/Dockerfile index f739364..f380502 100644 --- a/python/Dockerfile +++ b/python/Dockerfile @@ -1,12 +1,12 @@ FROM python:3.11-alpine + COPY . /app WORKDIR /app -# Install build dependencies -RUN apk add --no-cache gcc g++ - -RUN pip3 install -r /app/requirements.txt -RUN apk del gcc g++ +RUN apk add --virtual build-deps --no-cache gcc g++ \ + && pip3 install -r /app/requirements.txt \ + && apk del build-deps EXPOSE 5000 + ENTRYPOINT ["python", "messages.py"]