Deploy Docker project in ElasticBeanstalk
Vložit
- čas přidán 26. 07. 2024
- PS: ElasticBeanstalk console now looks a bit different since AWS updated it, but the core concepts are still the same
In this video, you will learn how to deploy a Docker project in ElasticBeanstalk and you will also learn how to solve the most common problems that happen in the process:
- Timeout due to big Dockerfiles
- Using ECR to create a preconfigured Docker image
- Handling different architectures: ARM64 and X86
- Grant IAM permissions for ElasticBeanstalk to pull the ECR image
The project was a NestJS(NodeJS) project using Yarn to manage packages. One of the packages was 'bcrypt', which is a library to manage user password encryption, which requires Python3 to be installed on the machine.
Helpful links:
- docs.aws.amazon.com/elasticbe...
- docs.aws.amazon.com/elasticbe...
0:00 - Introduction
1:30 - Create ElasticBeanstalk project
5:55 - Upload zipped code to ElasticBeanstalk
7:54 - Solving timeout issue
10:12 - Create ECR project
14:40 - Using ECR into Dockerfile
15:00 - Zip updated project and upload to ElasticBeanstalk
16:20 - Observations related to ARM64/X86 architecture
18:20 - Grant IAM permissions for ECR
19:55 - Conclusion - Věda a technologie
Man you are simply great, while demonstrating the technique.
The best teacher of The online world
🤓🖥️
If im not wrong, you can use bcrypt-js and dont depend on python. Awesome video :)
Interesting! I didn’t know about that. Thanks for letting me know :)
Excellent!
Thank you, Lucas!
He makes my app. Recomendo
😂😂😂 thank you my friend!
Great
Thank you, Welliane!
Thanks for the video. Does ElasticBeanstalk detect that the exposed port of your container is 4000 and maps port 80 of the host to your container's port?
Hello, thanks for the question! By default, AWS uses port 5000 on an app.
But you can use a custom port by passing a PORT environment variable on ElasticBeanstalk docs.aws.amazon.com/elasticbeanstalk/latest/dg/nodejs-platform-proxy.html
- If that doesn't work, you can also override the NGINX configuration on ElasticBeanstalk and set another port on NGINX stackoverflow.com/questions/66074722/what-is-the-port-number-of-the-web-application-to-which-default-proxy-config-on
thanks sir, really helpfull
How much was the docker file size when you try to deploy first and it failed?
Sorry, it's been a while since I did this project. 😅 But if I remember well, the first issue was caused due to timeout to run all steps, not necessarily because the Docker file was too big. So, creating a new Docker file to cache some steps was required.
Thank you, I like your approach it helped me
Glad it was helpful 🙌🏼🙌🏼🙌🏼
If i am running on an x64 machine, how are we able to build an image for arm64?
I think that the easiest way to do it is to generate the image in an EC2 instance with ARM64 architecture
you are not using bcrypt to "encrypt" passwords, you are using bcrypt to "hash" them,, there is a huge difference
Thanks for pointing out
After 3 days of trying to get it to work, I'm giving up
Hey what was the problem?
@@computingpower It just complains that it expected my app to be version "sample" instead of 1
@@gustavostnt Is this on the ElasticBeanstalk console?
@@computingpower Yes, the web UI. I'll be using just regular RDS + EC2 for now