2
votes

I'm using Elastic Beanstalk to deploy a root app (node.js) and also want to run php code that node.js app needs to call in the same ec2 instance.

When I connect to the instance it says:

This EC2 instance is managed by AWS Elastic Beanstalk. Changes made via SSH WILL BE LOST if the instance is replaced by auto-scaling. [...]

It means that when I add php sources in /var/www/ folder (connected via ssh), it will be removed if the instance changes.

how could I run in the same instance node.js and php ?

2

2 Answers

1
votes

You can explore the multi container option based on ECS to run more than one container per beanstalk environment.

Documentation:

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_ecs.html

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_v2config.html

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_ecstutorial.html

Is there a particular reason you want both apps to run on the same instance?

0
votes

maybe something like this:

**

create an ".ebextensions/nodeinstall.config" file

**

commands:
    node_install:
    cwd: /tmp

    command: 'yum install -y nodejs --enablerepo=epel'

I ran into a similar situation a while back and this worked for me.

source: http://qpleple.com