Deploy on the Docker Swarm instance

  1. Chose a node in the swarm that has a public IP (needed so the general public can get there from browndog.ncsa.illinois.edu)
  2. Place the config.json on the node in /etc/transformations/ (will likely need to create this directory), and populate the json with proper values
  3. Port 5000 is used by the image, but it can be published to any port on the node. I use port 5050 here as an example, but if you want to use another port replace all instances of 5050 with your selected port.
  4. On bd-bastion use the devops aliases to deploy on prod or dev with `prod service create --detach --name prod-transformations-catalog --label bd.level=prod --label bd.replicas.min=1 --label bd.replica.max=1 --replicas 1 --constraint 'node.hostname==<NODE NAME>' --containter-label project=BrownDog --container-label staging=prod --containter-label service=prod-transformations-catalog --mode replicated --publish 5050:5000 --mount type=bind,source=/etc/transformations/config.json,destination=/app/instance/config.json --host "bd-mongo-1.os.ncsa.edu:141.142.210.189" --host "bd-mongo-1.os.ncsa.edu:141.142.210.190" --host "bd-mongo-3.os.ncsa.edu:141.142.210.192" browndog/transformations-catalog:latest`
    1. detach says to not connect to the container as soon as it starts
    2. The labels are for internal use, docker doesn't need them
    3. replicas sets how many of these to create
    4. constraint limits the container to the given host name. Needed because of the public IP requirement, and the configuration file needing to be located on the machine
    5. publish maps the port from the host to the port in the container
    6. mount places the config file from the host into the proper place in the container
    7. host entries need to be in place to use the public IPs of the mongo servers, without these the container won't crash but won't return data (leading to 500 level errors)
  5. Modify the apache configurations on browndog.ncsa.illinois.edu, specifically in /etc/apache2:
    1. /conf-available/browndog.conf, add these lines:
ProxyPass	/transformations/ http://<NODE PUBLIC IP>:5050/
ProxyPassReverse	/transformations/ http://<NODE PUBLIC IP>:5050/
RedirectMatch permanent	^/transformations$ /transformations/

b. sites-available/000-default.conf, add this line:

Redirect permanent	/transformations/ https://browndog.ncsa.illinois.edu/transformations/

c. sites-available/default-ssl.conf, add these lines:

	ProxyPass	/transformations/ http://<NODE PUBLIC IP:5050/transformations/ nocanon
    ProxyPassReverse	/transformations/ http://<NODE PUBLIC IP:5050/transformations
    RedirectMatch permanent	^/transformations$ /transformations/

d. sites-enabled/000-default.conf, and default-ssl.conf, are links to the sites-available files, so automatically updated.