- Install MongoDB (https://www.mongodb.com/docs/manual/installation/).
- Install NodeJS (https://nodejs.org/en/download)
- Install Docker (https://docs.docker.com/engine/install/)
- Go to the
frontend
directory - Rename
env.example
to.env
(Or export variables) - Install frontend dependencies
npm ci
- Finally, run server
npm run dev
$ cd frontend
$ mv env.example .env
$ set -a; . ./.env; set +a
$ npm ci
$ npm run dev
To run from Docker, recompile with:
sudo docker build -t frontend .
and run (or re-run) with:
sudo docker run --env-file .env -p 80:80 --rm --name frontend frontend:latest
- Go to the
backend
directory - Rename
env.example
to.env
(Or export variables) - Install frontend dependencies
npm ci
- Finally, run server
npm run dev
$ cd backend
$ mv env.example .env
$ set -a; . ./.env; set +a
$ npm ci
$ npm run dev
- Clone FC-Woker repository.
- Build docker image (
docker build -t fc-worker .
) - Run docker image (
docker run -p 9000:8080 --name fc_worker fc-worker:latest
)
$ git clone [email protected]:Ondsel-Development/FC-Worker.git
$ cd FC-Worker
$ docker build -t fc-worker .
$ docker run -p 9000:8080 --name fc_worker fc-worker:latest
- DEV
- Production
- Frontend: https://lens.ondsel.com/
- Backend API: https://lens-api.ondsel.com/
- API docs: https://lens-api.ondsel.com/docs/
- Merge code to production branch.
- Now, create a zip file of backend and frontend source code. Run following commands:
git fetch origin
git checkout origin/production
cd backend
zip -r ./od-backend.zip .
cd ../frontend
- add the
.env
file that you have zip -r ./od-frontend.zip .
- Login to AWS dashboard (https://console.aws.amazon.com/console/home).
- Open
Elastic Beanstalk
app (https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/environments) - Deploying backend service (https://lens-api.ondsel.com/).
- Open
od-backend-prod-app-env
environment. - Click on
Upload and deploy
button. - This will open a dialog to upload ZIP.
- Upload
od-backend.zip
file and in Version label put commit hash (i.ed7fb86244117efb679edd0bb41bedf230cb2fc19
) - This will deploy backend service (https://lens-api.ondsel.com/)
- Open
- Deploying frontend service (https://lens.ondsel.com/).
- Open
od-frontend-prod-app-env
environment. - Click on
Upload and deploy
button. - This will open a dialog to upload ZIP.
- Upload
od-frontend.zip
file and in Version label put commit hash (i.ed7fb86244117efb679edd0bb41bedf230cb2fc19
)
- Open
- Login to AWS dashboard and open EC2 page.
- Open
od-backend-prod-app-env
instance page. - Click on Connect to Instance button.
[root@ip-172-31-26-128 ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9987508aaaa4 9bd321c31a70 "docker-entrypoint.s…" 4 hours ago Up 4 hours 3030/tcp vigorous_dirac
[root@ip-172-31-26-128 ~]# docker exec -it 9987508aaaa4 /bin/sh
/app # npm run migration <migration_name> > <migration_name>.logs
/app # exit
[root@ip-172-31-26-128 ~]# exit