0

I have searched through the Internet but I have not found any solution, or maybe I have not searched correctly, don't know.

I was wondering if there is anyway of running a multiple websites in a single Docker container from a single Docker image.

What I am trying to obtain is a website-path-replication of my project repository.

For example, let say I have following repository branches:

/master
/rc
/develop
/feature
    /some-new-change
    /another-change
    /something-waiting-mr
/fix
    /client-urgent-fix
    /some-bug

On the browser I want to have following URLs:

https?://path:port/master
https?://path:port/rc
https?://path:port/develop
https?://path:port/feature/some-new-change
https?://path:port/feature/another-change
https?://path:port/feature/something-waiting-mr
https?://path:port/fix/client-urgent-fix
https?://path:port/some-bug

Obviously, those would be only visible from private network, while public proxy will point always to /master endpoint hook.

The project is a Webpack compiled WebApplication (ReactJS, SASS, etc.) and the target is to deploy each branch version of the application inside its own service folder.

Current status:

Within a network environment, have a machine running several docker containers, each container mapped from image port to public server port.

CI+CD scripts runs on each repository push just for a selected branch and deploys a docker image, holding Apache Web Server, into its container.

In this way, I only have one and unique bundled application within the /var/www of the Apache's server, but what I am trying is to obtain the above explanation.

What I have found on the Internet is to publish multiple Docker images in a single container.

Any idea?

Thanks for your time and responses.

2
  • Configure your container and web server appropriately? It's unclear what you're working with and what you have tried.
    – Seth
    Commented Sep 12, 2019 at 9:52
  • @Seth added current status to question. Commented Sep 12, 2019 at 10:30

1 Answer 1

0

You don't need to build a docker image with the web contents. You can have a web image with only the server "machinery" in it, that uses bind-mount volumes to add directories at run time (at the adequate locations to the server. So your CI/CD just deploys to the host filesystem, and this can be immediately taken in account by the curently running container (if the server has an internal cache, you may have to restart the container, but you won't need to rebuild it for this).

1
  • That is the other solution. Got CI+CD solution to build and deploy compiled sources into a network-available-drive and then use Docker image to point those shared drives. Thanks. Commented Sep 13, 2019 at 6:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .