Skip to content

Commit

Permalink
Updating Circle CI config to move to Buildx setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ShahanaFarooqui committed Jun 25, 2024
1 parent 125a3b6 commit 1c4855e
Show file tree
Hide file tree
Showing 7 changed files with 1,386 additions and 1,599 deletions.
104 changes: 0 additions & 104 deletions .circleci/config.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build docker images

on:
push:
tags:
- '^v[0-9]{2}\.[0-9]{2}(\.[0-9]{1,2})?$'
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up version
id: set-version
run: |
if [ "${{ github.event.inputs.version }}" != "" ]; then
VERSION=${{ github.event.inputs.version }}
elif [ "${{ github.ref_type }}" == "tag" ]; then
VERSION=${{ github.ref_name }}
else
echo "No version provided and no tag found."
exit 1
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: |
shahanafarooqui/rtl:${{ env.VERSION }}
70 changes: 70 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
FROM node:18-alpine as base-builder

WORKDIR /RTL

COPY package.json /RTL/package.json
COPY package-lock.json /RTL/package-lock.json

RUN npm install --legacy-peer-deps

COPY . .

# Build the Angular application
RUN npm run buildfrontend

# Build the Backend from typescript server
RUN npm run buildbackend

# Remove non production necessary modules
RUN npm prune --omit=dev --legacy-peer-deps

FROM arm32v7/node:18-alpine as runner-arm32v7

WORKDIR /RTL

COPY --from=base-builder /RTL/rtl.js ./rtl.js
COPY --from=base-builder /RTL/package.json ./package.json
COPY --from=base-builder /RTL/frontend ./frontend
COPY --from=base-builder /RTL/backend ./backend
COPY --from=base-builder /RTL/node_modules/ ./node_modules
COPY --from=base-builder /tini /sbin/tini

EXPOSE 3000

ENTRYPOINT ["/sbin/tini", "-g", "--"]

CMD ["node", "rtl"]

FROM arm64v8/node:18-alpine as runner-arm64v8

WORKDIR /RTL

COPY --from=base-builder /RTL/rtl.js ./rtl.js
COPY --from=base-builder /RTL/package.json ./package.json
COPY --from=base-builder /RTL/frontend ./frontend
COPY --from=base-builder /RTL/backend ./backend
COPY --from=base-builder /RTL/node_modules/ ./node_modules
COPY --from=base-builder /tini /sbin/tini

EXPOSE 3000

ENTRYPOINT ["/sbin/tini", "-g", "--"]

CMD ["node", "rtl"]

FROM node:18-alpine as runner-amd64

WORKDIR /RTL

COPY --from=base-builder /RTL/rtl.js ./rtl.js
COPY --from=base-builder /RTL/package.json ./package.json
COPY --from=base-builder /RTL/frontend ./frontend
COPY --from=base-builder /RTL/backend ./backend
COPY --from=base-builder /RTL/node_modules/ ./node_modules
RUN apk add --no-cache tini

EXPOSE 3000

ENTRYPOINT ["/sbin/tini", "-g", "--"]

CMD ["node", "rtl"]
46 changes: 0 additions & 46 deletions dockerfiles/Dockerfile

This file was deleted.

49 changes: 0 additions & 49 deletions dockerfiles/Dockerfile.arm32v7

This file was deleted.

48 changes: 0 additions & 48 deletions dockerfiles/Dockerfile.arm64v8

This file was deleted.

Loading

0 comments on commit 1c4855e

Please sign in to comment.