| .husky | ||
| docker | ||
| env | ||
| public | ||
| src | ||
| .dockerignore | ||
| .env.example | ||
| .eslintrc.json | ||
| .gitignore | ||
| .npmrc | ||
| declaration.d.ts | ||
| Dockerfile | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| webpack.config.ts | ||
Alley-HSBC-Frontend
Build docker image from Dockerfile
-
cd into the root of this repository.
-
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. - run
Deploy in docker (docker-compose)
-
Deploy using docker-compose.yml.
-
Make sure both docker and docker-compose are installed.
-
If you pull image teamalley/digital-walkaround from dockerhub
- You need to first login to dockerhub by running
docker logincommand. 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>
- You need to first login to dockerhub by running
-
cd into the direct where you store the "docker-compose.yml" file.
-
- run
docker-compose up -dto start the service. - run
docker-compose downto stop the service
- run
-
You can access it on port 3000 by default. To change the port number, edit docker-compose.yml. Under ports, replace
3000:3000with<the port number you want>:3000. Then stop the service and start it again. -
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 upwithout-doption to show the error messages.
- 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.
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.
- 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
screeninstalled is recommended. - clone the repository and
cdinto the root folder of the repository. - If you are installing it on a linux machine with
screeninstalled, runscreen -S <name>to create a new screen. where<name>can be any name you choose. - run
npm run start-prod - if you followed step 3, press
CTRL ^Athen pressDwhile holdingCTRL ^A. The screen will detach. - 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.