This repository has been archived on 2022-05-20. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
estebanm123 9683a55cd5
Merge pull request #77 from CPSC319-Winter-term-2/live-participant-update-bug-fix
status update fixed and warning message added
2022-04-01 19:54:56 -07:00
.husky add boilerplate (try 2) 2022-02-16 19:23:47 -08:00
docker fixed but with start-prod 2022-04-01 12:01:06 +01:00
env fix typo 2022-03-31 20:24:49 +01:00
public add boilerplate (try 2) 2022-02-16 19:23:47 -08:00
src status update fixed and warning message added 2022-03-31 14:58:12 -07:00
.dockerignore changed docker-compose and readme 2022-04-01 03:57:11 +01:00
.env.example add boilerplate (try 2) 2022-02-16 19:23:47 -08:00
.eslintrc.json turn off eslint linebreak-style errors 2022-03-01 01:53:35 -08:00
.gitignore add boilerplate (try 2) 2022-02-16 19:23:47 -08:00
.npmrc add boilerplate (try 2) 2022-02-16 19:23:47 -08:00
declaration.d.ts navbar completed 2022-02-28 20:21:06 -08:00
Dockerfile fix typo 2022-03-31 20:24:49 +01:00
package-lock.json status update fixed and warning message added 2022-03-31 14:58:12 -07:00
package.json fix typo 2022-03-31 20:24:49 +01:00
README.md fixed but with start-prod 2022-04-01 12:01:06 +01:00
tsconfig.json navbar completed 2022-02-28 20:21:06 -08:00
webpack.config.ts fixed but with start-prod 2022-04-01 12:01:06 +01:00

Alley-HSBC-Frontend

Build docker image from Dockerfile

  1. cd into the root of this repository.

  2. On Windows

    • run docker build --tag <image-name> .

    On Linux

    • run DOCKER_BUILDKIT=1 docker build --tag <image-name> .

    Where <image-name> is the name you give to the image.

Deploy in docker (docker-compose)

  1. Deploy using docker-compose.yml.

  2. Make sure both docker and docker-compose are installed.

  3. If you pull image teamalley/digital-walkaround from dockerhub

    • You need to first login to dockerhub by running docker login command. The Username and LoginToken are provided under files in the "docker" directory

    If you built your own image

    • Please Replace the image name in "docker-compose.yml" with <image-name>
  4. cd into the direct where you store the "docker-compose.yml" file.

    • run docker-compose up -d to start the service.
    • run docker-compose down to stop the service
  5. You can access it on port 3000 by default. To change the port number, edit docker-compose.yml. Under ports, replace 3000:3000 with <the port number you want>:3000. Then stop the service and start it again.

  6. Node: you may exprience issues running the container on machines with limited ram.

    • If you are running this container on a server with 2-3 GiB of ram, you need to uncomment the two "environment" lines that sets "--max-old-space-size=1536" to allow node to allocate up to 1.5 GiB of ram. Also make sure there are no other programs on your system that requires lots of ram.
      You should not run this container on machines with less than 2 GiB of ram
    • If the container restarts unexpectedly, try running the container with docker-compose up without -d option to show the error messages.

Deploy directly on a Server

If You prefer installing it directly or you are expriencing some issues with the docker container. Follow the instructions bellow.

  1. Make sure you have a server with node v16.14.0 and npm 8.3.1 installed (other versions may work but not guaranteed). A linux machine with screen installed is recommended.
  2. clone the repository and cd into the root folder of the repository.
  3. If you are installing it on a linux machine with screen installed, run screen -S <name> to create a new screen. where <name> can be any name you choose.
  4. run npm run start-prod
  5. if you followed step 3, press CTRL ^A then press D while holding CTRL ^A. The screen will detach.
  6. You can then access it on port 3000

Setup Reverse Proxy

You can use Apache, Ngnix or other tools to set up a reverse proxy and connect it to a hostname. here is a guide on apache reverse proxy setup.

Enable HTTPS

You might want to enable https to secure your webapp since it includes private information (such as your username and password). here is a guide on enabling https with Let's Entrypt on a Ubuntu server with apache.