I am trying to deploy simple phpinfo.php to ECS (Amazon EC2 Container Service).
I was told that if I Dockerize my app and push resulting image to Amazon ECR (Elastic Container Registry), EC2 can easily get app from there.
I did that and NOW I have hit another road block.
After deploying in EC2 container, the problem is that my app is in ONLY phpfpm container in folder /var/www/html/ but IT IS NOT VISIBLE IN my nginx container.
Due to this problem, nginx does not delivery my app.
Please note that app is not in the host device EC2, nor it is in nginx, it is only in php-fpm. How to solve this problem? Please advise. Thanks
docker-compose.yml
version: '2'
services:
nginx:
image: 607167.dkr.ecr.ap-southeast-1.amazonaws.com/nginx:1
cpu_shares: 50
mem_limit: 134217728
ports:
- "80:80"
links:
- phpfpm
phpfpm:
image: 60547.dkr.ecr.ap-southeast-1.amazonaws.com/phpinfo:latest
cpu_shares: 50
mem_limit: 134217728
ports:
- "9000:9000"
- "3306:3306"
I tried add this line to both containers in yml file but then my containers fail to load.
volumes:
- .:/var/www/html
Please help. Thanks