Skip to content

Production Environment

Mana Azarm edited this page Sep 7, 2021 · 21 revisions

For production environment, we create a docker image of the client side app and a separate image for the server side app. Then, we run these images through the docker-compose.yml file placed in the root directory. Finally, we save the docker files; transfer the two images to the production server, and rebuild the docker images on the server. The following instructions guide you through all these steps in bash commands: Post to production:

Step 0: prerequisites

Change the .env file in the solution to include the following values:

POSTGRES_PASS = moduleteam POSTGRES_HOST = host.docker.internal

Step1: generate docker images

  1. From client folder: docker build -t reactapp .
  2. From server folder: docker build -t simapp .
  3. From the root folder run : docker-compose up -d

Step2: save images on your local disk

Create a folder on your disk to house the docker images

  1. docker save -o reactapp reactapp
  2. docker save -o simapp simapp

Step3: send images to server

"mana" is the name of a user on the production server. Before this stage, you have to have a user created on the server for you that also includes your ssh public key for authentication. Then replace "mana" with your own username and run the following commands:

  1. scp reactapp mana@edusim.ca:dimages
  2. scp simapp mana@edusim.ca:dimages

Step4: load the images on the server

  1. sudo docker load < reactapp
  2. sudo docker load < simapp

Step5: navigate to TeamLeadershipSimulator folder and run the command below:

$ sudo docker-compose up -d

Clone this wiki locally