-
Notifications
You must be signed in to change notification settings - Fork 23
Docker/setup push pipeline #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Manoj-14
merged 21 commits into
Manoj-14:stage
from
parth5012:docker/setup-push-pipeline
Jan 13, 2026
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
9cb411f
Release version 2.1.0
Manoj-14 090afb3
Release version 2.1.1
Manoj-14 bcd13fa
Release version 2.1.2
Manoj-14 405312d
Release version 2.2.0
Manoj-14 1734c2f
Created docker-publish.yml
parth5012 a67cb90
Improved tags
parth5012 195ac46
Added DockerFile
parth5012 113d46a
Updated docker-publish
parth5012 31b993b
Fixed docker-publish
parth5012 bee50da
removed docker.yml
parth5012 c3cc2eb
Fixed issue in building login service
parth5012 148e2d6
Removed testing branch name
parth5012 644e54f
fix: add stage branch to workflow triggers
parth5012 e9740bc
Added Manual Trigger and Version Input
parth5012 2c7d761
Fixed the Comment
parth5012 b7c8423
Removed Additional Branches
parth5012 24e0048
fix: allow per-service versioning and implement manual tag usage
parth5012 3ba724a
Added Version overriding
parth5012 60dd094
Removed Testing Branch
parth5012 4206424
fix:Removed hardcoded versions from matrix services
parth5012 e5c170f
Removed testing branch
parth5012 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,70 @@ | ||
| name: Docker Build & Push Services | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "master"] | ||
| # Manual Trigger with dropdown | ||
| workflow_dispatch: | ||
| inputs: | ||
| service_target: | ||
| description: 'Which service to build?' | ||
| required: true | ||
| type: choice | ||
| default: 'all' | ||
| options: | ||
| - all | ||
| - auth-service | ||
| - frontend-service | ||
| - login-service | ||
| - metadata-service | ||
| - notification-service | ||
| version: | ||
| description: 'Version Tag (e.g., v1.2.0)' | ||
| required: false | ||
| default: '' | ||
|
|
||
| jobs: | ||
| build-and-push-services: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| service: | ||
| - name: auth-service | ||
| image_suffix: microforge-auth-service | ||
| - name: frontend-service | ||
| image_suffix: microforge-frontend-service | ||
| - name: login-service | ||
| image_suffix: microforge-login-service | ||
| - name: metadata-service | ||
| image_suffix: microforge-metadata-service | ||
| - name: notification-service | ||
| image_suffix: microforge-notification-service | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Login to Docker Hub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKER_USERNAME }} | ||
| password: ${{ secrets.DOCKER_PASSWORD }} | ||
| - name: Build and push | ||
| uses: docker/build-push-action@v5 | ||
| # LOGIC: Run if target is 'all' OR matches the current service name | ||
| if: ${{ inputs.service_target == 'all' || inputs.service_target == matrix.service || github.event_name == 'push' }} | ||
| env: | ||
| # Logic: Only create this tag if input.version is NOT empty | ||
| MANUAL_TAG: ${{ inputs.version != '' && format('{0}/microforge:{1}-{2}', secrets.DOCKER_USERNAME, matrix.service, inputs.version) || '' }} | ||
| with: | ||
| context: . | ||
| file: ./Dockerfile | ||
| target: ${{ matrix.service.name }} | ||
| push: true | ||
| tags: | | ||
| ${{ secrets.DOCKER_USERNAME }}/microforge:${{ matrix.service.name }}-latest | ||
| ${{ secrets.DOCKER_USERNAME }}/microforge:${{ matrix.service.name }}-${{ github.sha }} | ||
| ${{ env.MANUAL_TAG }} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,117 @@ | ||
| # Dockerfile for MicroForge | ||
|
|
||
| # ============================================================================== | ||
| # Auth Service | ||
| # ============================================================================== | ||
| FROM golang:1.25.1-bookworm AS auth-service-builder | ||
|
|
||
| WORKDIR /usr/src/app | ||
|
|
||
| COPY ./src/auth-service/go.mod ./src/auth-service/go.sum ./ | ||
| RUN go mod download | ||
|
|
||
| COPY ./src/auth-service/ ./ | ||
|
|
||
| RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -ldflags "-s -w" -o /auth-service main.go | ||
|
|
||
| FROM gcr.io/distroless/static-debian12:nonroot AS auth-service | ||
| WORKDIR /usr/src/app | ||
|
|
||
| COPY --from=auth-service-builder /auth-service ./ | ||
|
|
||
| EXPOSE 8082 | ||
|
|
||
| ENTRYPOINT [ "./auth-service" ] | ||
|
|
||
| # ============================================================================== | ||
| # Frontend Service | ||
| # ============================================================================== | ||
| FROM docker.io/library/node:22-slim AS frontend-service-builder | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY ./src/frontend-service/package.json ./src/frontend-service/package-lock.json ./ | ||
| RUN npm ci | ||
|
|
||
| COPY ./src/frontend-service/src/ ./src/ | ||
| COPY ./src/frontend-service/public/ ./public/ | ||
|
|
||
| RUN npm run build | ||
|
|
||
| FROM nginx:alpine AS frontend-service | ||
| COPY --from=frontend-service-builder /app/build /usr/share/nginx/html | ||
| COPY ./src/frontend-service/nginx.conf /etc/nginx/conf.d/default.conf | ||
| COPY ./src/frontend-service/config.template.json /usr/share/nginx/html/config.template.json | ||
| COPY ./src/frontend-service/frontendEntrypoint.sh /frontendEntrypoint.sh | ||
| RUN chmod +x /frontendEntrypoint.sh | ||
|
|
||
| EXPOSE 80 | ||
| ENTRYPOINT [ "/frontendEntrypoint.sh" ] | ||
|
|
||
| # ============================================================================== | ||
| # Login Service | ||
| # ============================================================================== | ||
| FROM eclipse-temurin:21.0.5_11-jdk-jammy AS login-service-builder | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY ./src/login-service/mvnw ./ | ||
| COPY ./src/login-service/.mvn/ ./.mvn/ | ||
| COPY ./src/login-service/pom.xml ./ | ||
|
|
||
| RUN chmod +x mvnw && ./mvnw dependency:go-offline | ||
|
|
||
| COPY ./src/login-service/src ./src/ | ||
|
|
||
| RUN ./mvnw clean package -DskipTests | ||
|
|
||
| FROM gcr.io/distroless/java21-debian12:latest AS login-service | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY --from=login-service-builder /app/target/login-service-1.0.0.jar login-service.jar | ||
|
|
||
| EXPOSE 8081 | ||
|
|
||
| ENTRYPOINT [ "java" , "-jar", "login-service.jar" ] | ||
|
|
||
| # ============================================================================== | ||
| # Metadata Service | ||
| # ============================================================================== | ||
| FROM docker.io/library/python:3.12-alpine3.22 AS metadata-service-builder | ||
|
|
||
| RUN apk update && \ | ||
| apk add gcc g++ linux-headers | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY ./src/metadata-service/requirements.txt requirements.txt | ||
|
|
||
| RUN python -m venv /opt/venv && \ | ||
| /opt/venv/bin/pip install -r requirements.txt | ||
|
|
||
| FROM docker.io/library/python:3.12-alpine3.22 AS metadata-service | ||
|
|
||
| COPY --from=metadata-service-builder /opt/venv /opt/venv | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY ./src/metadata-service/ . | ||
|
|
||
| CMD ["/opt/venv/bin/gunicorn", "app:app", "--workers", "4", "--bind", "0.0.0.0:8084"] | ||
|
|
||
| # ============================================================================== | ||
| # Notification Service | ||
| # ============================================================================== | ||
| FROM node:18-alpine AS notification-service-builder | ||
| WORKDIR /app | ||
| COPY ./src/notification-service/package.json ./src/notification-service/package-lock.json ./ | ||
| RUN npm ci | ||
|
|
||
| FROM gcr.io/distroless/nodejs18-debian11:nonroot AS notification-service | ||
| WORKDIR /app | ||
|
|
||
| COPY --from=notification-service-builder /app/node_modules ./node_modules | ||
| COPY ./src/notification-service/ . | ||
|
|
||
| CMD [ "app.js" ] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.