Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
387 views
in Technique[技术] by (71.8m points)

Deploy Angular App with Spring Boot (on AWS)

I have an angular app running on localhost at port 4200 and spring boot on port 808. I want to deploy the Angular & Spring Boot Applications, but for me it is not clear what best practices are. I wanted to deploy the Angular application in AWS S3 and package the Spring application in a Docker container. Then I wanted to configure a proxy in Angular.

Now I have read an article that says that this method is not suitable for production.

Why is it not suitable for production and what are the better alternatives?

Many Thanks!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I think you are almost there. You are quite right. You can deploy the frontend angular app dist folder to S3 as a static website, then deploying your backend spring-boot app on docker is perfect. This can run on elastic beanstalk, ec2, ECS, and now even lambda.

You will need environment variables for the backend and frontend code, so they know how to communicate with each other, i.e., https://my_S3_URL_angular_site.com/ for your S3 bucket and https://my_EC2_URL_springboot_server.com/, but you do not need to use any proxies.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...