jHipster Registry on AWS Beanstalk

After some trial and error I ended up doing something like this:

  1. Clone https://github.com/jhipster/jhipster-registry

  2. Build a Docker container locally with ./mvnw package -Pprod verify jib:dockerBuild

  3. Create an ECR registry in AWS console or using AWS CLI as follows: aws --profile [AWS_PROFILE] ecr create-repository --repository-name [ECR_REGISTRY_NAME]

  4. Assuming that v6.3.0 was cloned in step 1, tag the local Docker as follows: image docker tag [IMAGE_ID] [AWS_ACCOUNT].dkr.ecr.[AWS_REGION].amazonaws.com/[ECR_REGISTRY_NAME]:jhipster-registry-6.3.0

  5. Authenticate to ECR as follows: eval $(aws --profile [AWS_PROFILE] ecr get-login --no-include-email --region [AWS_REGION])

  6. Push the local Docker image to ECR as follows: docker push [AWS_ACCOUNT].dkr.ecr.[AWS_REGION].amazonaws.com/[ECR_REGISTRY_NAME]:jhipster-registry-6.3.0

  7. Set up Elastic Beanstalk (EB) CLI

  8. Initialize local EB project as follows: eb init --profile [AWS_PROFILE]

  9. Create Dockerrun.aws.json with the following content:

{
  "AWSEBDockerrunVersion": "1",
  "Image": {
    "Name": "[AWS_ACCOUNT].dkr.ecr.[AWS_REGION].amazonaws.com/[ECR_REGISTRY_NAME]:jhipster-registry-6.3.0",
    "Update": "true"
  },
  "Ports": [
    {
      "ContainerPort": 8761
    }
  ]
}

  1. Run jhipster-locally as follows: eb local run --port 8761

  2. Verify that you can access jhipster-registry locally as follows: eb local open

  3. Create a new EB environment running the Docker image from the ECR as follows: eb create [EB_ENV_NAME] --instance-types t2.medium --keyname [EC2_KEY_PAIR_NAME] \ --vpc.id [VPC_ID] --vpc.ec2subnets [EC2_SUBNETS] --vpc.publicip --vpc.elbpublic --vpc.securitygroups [CUSTOM_ELB_SG]

  4. Access remote jhipster-registry as follows: eb open

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top