Skip to content

[C4GT Community]: Dockerize AMRIT Platform #59

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

Open
5 tasks
drtechie opened this issue Mar 31, 2025 · 16 comments
Open
5 tasks

[C4GT Community]: Dockerize AMRIT Platform #59

drtechie opened this issue Mar 31, 2025 · 16 comments

Comments

@drtechie
Copy link
Member

drtechie commented Mar 31, 2025

Ticket Contents

Description

AMRIT Platform consists of several service lines. Service lines are split into a UI frontend and an associated API backend. In addition to these UI-API pairs, you will find additional microservices common across service line specific API services. You will find the list of repos and services in AMRIT repo README.

We have created a docker-compose.yml file for setting up infra of AMRIT platform. This ticket is a continuation of the process.

Create a production-ready containerized system for multiple Angular UI applications and Spring Boot microservices using Docker and Nginx reverse proxy. The solution should enable secure communication between frontend and backend services while maintaining isolated environments and efficient resource utilization.

Goals

Goals

  • Dockerize Angular UI applications with Nginx serving static assets
  • Create Docker images for Spring Boot microservices
  • Configure Nginx reverse proxy for API routing
  • Implement Docker Compose for multi-service orchestration
  • Document setup and deployment process

Expected Outcome

  • Multiple Docker containers running in isolated network environments
  • Angular applications accessible via unified domain with path-based routing
  • API endpoints proxied through Nginx with proper CORS configuration
  • Automated build process using multi-stage Dockerfiles
  • Health-check endpoints for all services

Acceptance Criteria

  1. All services start successfully via docker-compose up
  2. UI applications remain functional after page refresh
  3. Zero hard-coded IP addresses in configuration
  4. Comprehensive logging for inter-service communication
  5. Secrets and keys must be managed in .env or relevant environment configuration

Implementation Details

Dockerization Strategy for Spring Boot Microservices
Individual Docker Images per service
Each microservice requires its own Dockerfile for isolation and scalability:

Network Configuration
Use separate networks for frontend/backend segregation
Allow cross-network communication for UI-to-API access

For UI services, each UI build files must be added in nginx root.

Example implementation details

Dockerfile

# Stage 1: Build Angular Applications
FROM node:16-alpine AS builder

WORKDIR /usr/src/app

# Build UI app1
# Clone and build UI app1

# Build UI app2
# Clone and build UI app2

# Stage 2: Serve with Nginx
FROM nginx:alpine

# Remove default Nginx configuration
RUN rm /etc/nginx/conf.d/default.conf

# Copy custom Nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf

# Copy built Angular apps to Nginx HTML directory
COPY --from=builder /usr/src/app/dist/app1 /usr/share/nginx/html/app1
COPY --from=builder /usr/src/app2/dist/app2 /usr/share/nginx/html/app2

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]

Docker compose

version: '3.8'
services:
  # Spring Boot Microservices
  hwc-service:
    build: ./hwc-service
    ports:
      - "8081:8080"
    networks:
      - backend
    depends_on:
      mysql:
        condition: service_healthy

  common-api-service:
    build: ./common-api-service
    ports:
      - "8082:8080"
    networks:
      - backend

  # Angular UI
  angular-ui:
    build: ./angular-ui
    ports:
      - "80:80"
    networks:
      - frontend
      - backend

networks:
  frontend:
  backend:

volumes:
  # for mongo, mysql and redis

Nginx reverse proxy config

server {
    listen 80;
    
    # Serve Angular App
    location / {
        root /usr/share/nginx/html;
        try_files $uri $uri/ /index.html;
    }

    # Proxy API Requests
    location /api/hwc {
        resolver 127.0.0.11 valid=30s;  # Docker DNS
        proxy_pass http://hwc-api-service:8080/api;
        proxy_set_header Host $host;
    }

    location /api/common {
        resolver 127.0.0.11 valid=30s;  # Docker DNS
        proxy_pass http://common-api-service:8081/api;
        proxy_set_header Host $host;
    }
}

Mockups/Wireframes

NA

Product Name

AMRIT

Organisation Name

Piramal Swasthya Management and Research Institute

Domain

Healthcare

Tech Skills Needed

Docker, DevOps, Spring Boot, Angular

Organizational Mentor

@drtechie

Complexity

High

Category

Deployment

Bounty

This is a bounty ticket with a remuneration of INR 20,000.

@harshsennnn
Copy link

@drtechie u assign me with this

@kevalkanp1011
Copy link

instrested!. @harshsennnn we can work togethor on this issue

@harshsennnn
Copy link

@kevalkanp1011 yes sure lets fix a quick meet

@kevalkanp1011
Copy link

kevalkanp1011 commented Apr 1, 2025

Let's connect over mail for gmeet:- [email protected] @harshsennnn

@ChayanDass
Copy link

can i work on it? @drtechie

@kevalkanp1011
Copy link

kevalkanp1011 commented Apr 2, 2025

@harshsennnn can you tell me your suitable time for quick meet?

@Aaradhya-07
Copy link

@drtechie I'd like to work on this issue

@harshsennnn
Copy link

@harshsennnn can you tell me your suitable time for quick meet?

Hey @kevalkanp1011 ping me on discord
harshu3261

@Akshanshkaushal
Copy link

@drtechie I would like to work upon this issue !

@mohitkmeena
Copy link

@drtechie i would love to work on this issue.

@ashurohilla
Copy link

interested in this ..

@Suraj-kumar00
Copy link

Subject: Interest in Contributing to Dockerize AMRIT Platform - C4GT Issue #59

Hi @drtechie,

I hope you're doing well!

My name is Suraj, and I came across the C4GT issue #59 regarding Dockerizing the AMRIT Platform. I’m really excited about the opportunity to contribute, especially since it aligns perfectly with my experience in Docker, DevOps practices, and deploying containerized microservices.

I recently worked on projects involving multi-container orchestration using Docker Compose, setting up Nginx reverse proxies, and creating production-ready deployment pipelines. I've attached my github profile for reference, which details my DevOps experience, including CI/CD pipelines, Kubernetes, and AWS deployments.

I would love to collaborate on this and help containerize the Angular UIs and Spring Boot microservices, while ensuring secure and scalable service communication.

Please let me know can I be assigned to this issue to work on?

Looking forward to your response!

Best regards,
Suraj Kumar
GitHub

@Deeps966
Copy link

Can you please assign to me i got 5 years of experience in the programming world

@saransh-g1
Copy link

I have gone through the problem statement and found myself quite compatible with it can you please assign this issue to me ! @drtechie

@saransh-g1
Copy link

I was working on issue #59 and come to know that there are some environment variables which are missing from the repository telemedicine-ui can you some body tell me how to rectify it what is that bug these variables are named as printWebLoginPhrCard and getBenIdForhealthID. Apart from the TM-UI repository I have containerized all the UI repos and heading towards the microservices section

@harshsennnn
Copy link

harshsennnn commented Apr 13, 2025

@saransh-g1
i and @kevalkanp1011 are working on the issue and we are about to end this if we are unable to make it then u can go ahead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests