I have a PHP application that runs on Docker (php:5.6-apache image). I use AWS Elastic Beanstalk Multicontainer Docker Environment to deploy the app to the cloud (using Dockerrun.aws.json v2).
My problem is that I can't find a good workflow to update the composer dependencies after deploying.
Below the contents of my Dockerrun.aws.json:
{
"AWSEBDockerrunVersion": 2,
"volumes": [
{
"name": "php-app",
"host": {
"sourcePath": "/var/app/current/php-app"
}
}
],
"containerDefinitions": [
{
"name": "php-app",
"image": "php:5.6-apache",
"essential": true,
"memory": 512,
"portMappings": [
{
"hostPort": 80,
"containerPort": 80
}
],
"mountPoints": [
{
"sourceVolume": "php-app",
"containerPath": "/var/www/html",
"readOnly": true
}
]
}
]
}
What is the recommended way to run composer install on Elastic Beanstalk Multicontainer Docker Environment?
It is highly recommended to deploy your application with the dependencies pre-installed. Having your deployment process depend on github and packagist is fragile at best and not recommended. Ideally, you would never run Composer anywhere other than on your development and CI environment. Your CI environment should produce a fully deployable release package (including all dependencies etc.) for staging/production environments.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With