问题描述:

I am sure this is a quite simple question, but for some reason, I cannot find a definitive answer for it.

I have a local docker environment with php-fpm and nginx. Locally I am running it through docker-compose and part docker-compose.yml looks like this:

website:

build: ./website/

container_name: website

external_links:

- mysql:mysql

volumes:

- ~/Dev/priz/website:/var/www/html

proxy:

image: nginx

container_name: proxy

links:

- website:website

ports:

- "9080:80"

volumes:

- ~/Dev/priz/website:/var/www/html

- ./deployment/proxy/conf.d/default.conf:/etc/nginx/conf.d/default.conf

Where I am mounting the folder with a code to my host and developing on it.

So, in the end of a day, there is no code residing on php container itself.

The question I have is related to the actual deployment to multi docker environment on elastic beanstalk.

Since I need to bundle everything into one archive, does it mean that I need to bundle it with the code as well in order to mount it in the same way as I do locally.

Of coarse, there is an option to build an image with the code in it, but then I am kind of going against the whole docker idea. Also, I will have problems mounting the code to both containers.

That is the best practices in this case?

相关阅读:
Top