-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from Kong/package-services
Add Docker builds
- Loading branch information
Showing
6 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Build Docker Images | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
app: | ||
- dir: flight-data | ||
name: flights | ||
- dir: flight-data | ||
name: routes | ||
- dir: sales | ||
name: bookings | ||
- dir: sales | ||
name: customer | ||
- dir: . | ||
name: experience | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: "${{ matrix.app.dir }}/${{ matrix.app.name }}" | ||
push: true | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ghcr.io/kong/kongair-${{ matrix.app.name }}:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM node:20 | ||
|
||
ENV TINI_VERSION v0.19.0 | ||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini | ||
RUN chmod +x /tini | ||
|
||
WORKDIR /usr/src/app | ||
COPY package*.json ./ | ||
|
||
RUN npm ci --omit=dev | ||
|
||
COPY . . | ||
|
||
EXPOSE 4000 | ||
ENTRYPOINT ["/tini", "--"] | ||
CMD [ "node", "index.js" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM golang:1.20 as build | ||
|
||
WORKDIR /go/src/app | ||
COPY . . | ||
|
||
RUN go mod download | ||
RUN go vet -v | ||
RUN go test -v | ||
|
||
RUN CGO_ENABLED=0 go build -o /go/bin/app | ||
|
||
FROM gcr.io/distroless/static-debian11 | ||
|
||
COPY --from=build /go/bin/app / | ||
EXPOSE 8080 | ||
CMD ["/app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM golang:1.20 as build | ||
|
||
WORKDIR /go/src/app | ||
COPY . . | ||
|
||
RUN go mod download | ||
RUN go vet -v | ||
RUN go test -v | ||
|
||
RUN CGO_ENABLED=0 go build -o /go/bin/app | ||
|
||
FROM gcr.io/distroless/static-debian11 | ||
|
||
COPY --from=build /go/bin/app / | ||
EXPOSE 8080 | ||
CMD ["/app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM node:20 | ||
|
||
ENV TINI_VERSION v0.19.0 | ||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini | ||
RUN chmod +x /tini | ||
|
||
WORKDIR /usr/src/app | ||
COPY package*.json ./ | ||
|
||
RUN npm ci --omit=dev | ||
|
||
COPY . . | ||
|
||
EXPOSE 3000 | ||
ENTRYPOINT ["/tini", "--"] | ||
CMD [ "node", "main.js" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM node:20 | ||
|
||
ENV TINI_VERSION v0.19.0 | ||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini | ||
RUN chmod +x /tini | ||
|
||
WORKDIR /usr/src/app | ||
COPY package*.json ./ | ||
|
||
RUN npm ci --omit=dev | ||
|
||
COPY . . | ||
|
||
EXPOSE 3000 | ||
ENTRYPOINT ["/tini", "--"] | ||
CMD [ "node", "main.js" ] |