Multiple deployments on one server
Bitcart supports multiple deployments on one server.
Note that it is an advanced topic, and use it only if you know what you are doing.
When setting up multiple deployments on the same server, the services that export their ports to outside can't be run twice.
It means that you will need to set up nginx reverse proxy manually, and disable nginx in each of the deployments.
When disabling nginx, all the services will expose ports to outside, to be able to use them from nginx installed globally on the server.
To run multiple deployments, pass the deployment name via --name
argument. The default deployment name is compose
.
Note that you should use different clones of the bitcart-docker
for each deployment, as the setup script creates .env
file with all your settings, and .deploy
file with configuration name, and if you run different deployments in the same directory the configuration files will be overwritten.
Do it like so:
To disable reverse proxy, run:
Note that when running multiple deployments, the Merchants API, the admin and the store will have the same ports. You need to change that.
To change ports, run export BITCART_SERVICE_PORT=port
Where SERVICE
is the component name, and port
is the port, for example:
You should configure nginx yourself. The only recommendation is: it is easy to configure nginx via certbot.
Instead of disabling nginx, you may also leave it running at different ports, see this guide.
Run:
And it will create nginx config records for you, and then edit the location /
config, by using proxy_pass http://localhost:port
Note: when using multiple deployments on one server, environment variables may be loaded incorrectly on login (due to same environment variable names).
To ensure that you have loaded the correct environment for your deployment, in your deployment directory, run:
It will load the correct settings.
Last updated