-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Deploying to Amazon Elastic Beanstalk #244
Comments
I'm currently struggling through trying to do this. I'd appreciate some help with it as I'm totally lost trying to write a Dockerrun.aws.json file for the 5 containers that laradock created to dockerize the laravel project. |
I'm trying to deploy to Elastic Beanstalk I'm having issues when it too. Need help. |
Sample
|
@davehensley can you include your answer in the docs!? |
@Mahmoudz I'm not sure which docs you're referring to (laradock.io maybe?), but I'm not part of the Laradock project so I don't have write access to them. But if you do, you're more than welcome to copy my solution and include it there if you think it would be useful. |
@davehensley actually the site is hosted on Github and the readme files are in the project, so you can send a normal PR as you used to when updating the readme.md. Please refer to this docs for how to update the docs http://laradock.io/contributing/#update-documentation-site. Note: do not edit HTML files, someone did that mistake before, just edit the markdown files and re-generate the HTML from them, the link should help. Thanks for your quick response. Best, |
@davehensley Thanks for your answer. In that case, do I need to create each repository for each images in my ECR? For example, one for nginx, one for php-fpm, etc? Or I can create just one repository and tag all of them in that one repo? Sorry for my ignorance. Hope you can help me. |
@canfone You should create a separate repo for each image. |
@davehensley
I believe that there are processes I need to do before the steps you suggested. I don't know where or what to start. Do you have any suggestions or ideas what things I need to be done before following the steps you gave? Thanks. |
@canfone Hmm, what was the process that you used to create your EB app? Try something like this (it should download Laravel and deploy the default app):
|
@davehensley Thanks for your reply. I'm using awsebcli to create my EB app. I think I managed to create the app and deployed it to elastic beanstalk. However, my nginx configurations were not included in the nginx image of my ECR. Also, the application files is not in By the way, my laradock folder is outside the laravel application. |
@davehensley Nevermind my previous comment. I managed to mount nginx conf files. I just need to use volumes. Thanks for your help. |
Hi, Im follwing the guide that is provided above, i managed to create the laradock instance in elastic server via ecr. but the application is not working, im having 502 bad gateway error, and when I checked the apache2 container logs inside eb server, is says that SSLCertificateFile: file '/etc/ssl/certs/ssl-cert-snakeoil.pem' does not exist or is empty, how would i solve this one, in my local instance there is no ssl-cert issues, so the logic would be my local should be the same once i upload it on eb server. hope you could help me . thanks |
@chkm8 This is a bit outside the scope of the original question, but the answer is that it's easiest to set up a secure site on Elastic Beanstalk if the EC2 instances inside your EB environment don't know anything about SSL. Even if you're running a secure site, your webserver inside your docker container should be listening on port 80 only, so you don't even need to install mod_ssl. The job of storing SSL certificates and keys and encrypting the connection is performed by Amazon's Elastic Load Balancer. So the traffic goes like this: Your container <---port 80 (http)---> Elastic Load Balancer <---port 443 (https)---> Internet AFAIK there isn't a way to upload an SSL certificate/key through the AWS console, but you can do it pretty easily with the aws command line tool: Everything else is configurable through the AWS console (just allow incoming https connections in your Elastic Load Balancer's security group, and then enable HTTPS on port 443 in your load balancer settings and choose the certificate that you just uploaded from the dropdown menu). If you really do need full end-to-end encryption (which you almost certainly don't), or you're running a single-instance EB environment without a load balancer, then it is possible to configure your container to listen for https connections (but I strongly recommend trying the other way first): |
@davehensley , yup, the error is not related, i finally uploaded our project in EB following the guide you provided, the error I was referring to is how the "laradock apache2 container" was buid making a copy of the default ssl and with missing plugins (snakeoil). I rebuild a new one but remove the default ssl. |
Now that there is an Any help is welcome, a link, some pointer og where to research to...? |
The aws service was meant to provide easy tools to access aws using eb ssh. Are you having Forbidden error when you access your environment url? I also had trouble in setting it up first but I forgot the specific errors but what I learned was that make sure that you setup the security group of each containers, they should have access with port 80 and 443. Also you need to enable that the listener to your eb instance both 80 and 443. |
Thanks @chkm8 ! I'm also trying to access to the logs, but I can't. The app works perfectly in my local Docker btw :) Thanks! |
How did you deploy your project to elastic beanstalk? Can you do eb logs | grep apache2 inside the aws laradock container? or inside eb instance sudo docker logs ? |
I've deployed completely with eb cli. Followed the instructions: Thanks! I keep researching! |
If you wanted to deply your application using laradock, yes you need the Dockerrun.aws.json, there is a sample for that in the comment above on this thread. So if you dont use Dockerrun.aws.json, I assumed that when you did eb init you choose php as environment right? I havent tried deploying it in that way because I use the multiple docker options and I provided the Dockerrun.aws.json. |
I am using nginx, php-fpm, mariadb for one of the project. I followed the steps suggested by @davehensley and can see a successful deployment. (I am using multi docker instance in aws ebs) However, I was unable to see any nginx config when I |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi again 👋 we would like to inform you that this issue has been automatically |
Has anybody had any experience with this? Could you recommend some reading sources or point me in the direction of example config setups?
The text was updated successfully, but these errors were encountered: