2

So, I am Dockerizing my architecture which consists of multiple php applications ran on apache.

If I'm right I need: 1 nginx container, 1 php container and multiple data-containers to volume-from in the nginx container.

How would I be able to have multiple data container linked to my nginx container? So for example I got app1.domain.com volumed to /data/app1 and app2.domain.com volumed to /data/app2 etc etc.

1 Answer 1

3

You can create one volume container for each app:

  • app1: docker create -v /data/app1 --name app1 ....
  • app2: docker create -v /data/app2 --name app2 ....

Then link them to your nginx container with:

docker run --volumes-from app1 --volumes-from app2 --name nginx ... nginx ...

More information about volumes you can find in the official volumes documentation.

Sign up to request clarification or add additional context in comments.

7 Comments

And link the php and nginx to each other?
I would install nginx and php-fpm on the same image.
@guidsen you should use docker-compose for that.
@h3nrik so I would have a nginx-php container for each components that has a volume from a data container? Because I got issues running multiple application on the same nginx-php container.
No. The idea is to have only one single nginx/php container with the server installation and many data containers. What kind of issues do you have? Are they worth a separate question?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.