Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running multiple instances of GOST on 1 machine #4

Open
bertt opened this issue Oct 11, 2017 · 2 comments
Open

running multiple instances of GOST on 1 machine #4

bertt opened this issue Oct 11, 2017 · 2 comments

Comments

@bertt
Copy link
Contributor

bertt commented Oct 11, 2017

Question: How can we run multiple instances of GOST on a single machine?
examples:

  • a 'test' and a 'production' instance;
  • a separate instance for each customer (customer1, customer2)
@bertt
Copy link
Contributor Author

bertt commented Oct 11, 2017

One possible solution using docker tooling (docker-compose), see branch https://github.com/gost/docker-compose/tree/multiple_endpoints

changes:

# start production version on port 8080
export DASHBOARD_PORT=8080
docker-compose -p prod up -d

# start test version on port 8081
export DASHBOARD_PORT=8081
docker-compose -p test up -d

The startup.sh script sets the DASHBOARD_PORT variable (8080 for production, 8081 for test), and runs docker-compose up with the extra -p (Project) option.

After running this script there are 2 instances of GOST running on port 8080 and 8081. Using a proxy server these ports can be mapped to a subdomain (for example prod.my-gost.com and test.my-gost.com).

Result:

ccfb4af3ae3f        geodan/gost-dashboard   "/etc/nginx/docker-en"   6 seconds ago       Up 4 seconds        80/tcp, 0.0.0.0:8081->8080/tcp   test_dashboard_1
08654de5392d        geodan/gost             "/bin/sh -c ./gost"      6 seconds ago       Up 5 seconds        8080/tcp                         test_gost_1
9dd266a1c620        geodan/gost-db          "docker-entrypoint.sh"   7 seconds ago       Up 6 seconds        5432/tcp                         test_gost-db_1
ddbf159d1c4e        geodan/gost-dashboard   "/etc/nginx/docker-en"   21 seconds ago      Up 20 seconds       80/tcp, 0.0.0.0:8080->8080/tcp   prod_dashboard_1
9fd56490fb69        geodan/gost             "/bin/sh -c ./gost"      21 seconds ago      Up 20 seconds       8080/tcp                         prod_gost_1
e5fe45d57ca8        geodan/gost-db          "docker-entrypoint.sh"   22 seconds ago      Up 21 seconds       5432/tcp                         prod_gost-db_1

The instances of GOST are running in different networks: prod_default and test_default and they use different data volumes for storage: prod_postgis en test_postgis

An instance can be shut down using:

$ docker-compose -p test down
$ docker-compose -p prod down

@bertt bertt changed the title running multiple instances of gost running multiple instances of GOST on 1 machine Oct 11, 2017
@bertt
Copy link
Contributor Author

bertt commented Oct 11, 2017

another option is to make a copy of the docker-compose file in another folder
pro: more customizations possible
con: more difficult to maintain multiple copies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant