Reputation: 487
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!
Upvotes: 4
Views: 3237
Reputation: 2333
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.
Upvotes: 5