Deployment on local machine & exposure via NGINX.
In this guide we use Rocky Linux (similar as Red Hat Enterprise Linux).
-
NGINX server enabled:
sudo dnf install -y nginx sudo systemctl enable --now nginx
Disclaimer: In this guide, we assume that the current user name is tal.
-
Clone the NextStep Repository:
git clone git@github.com:NextStepFinalProject/NextStep.git && cd NextStepEdit the
nextstep-backend/.env, andnextstep-frontend/.envfiles:In the
nextstep-backend/.env, setup:FRONTEND_URL=http://nextstep.theworkpc.com:1785In the
nextstep-frontend/.env, setup:VITE_DOMAIN_NAME=0.0.0.0 VITE_ALLOWED_HOSTS=nextstep.theworkpc.com -
Setup build of frontend:
cd nextstep-frontend npm i npm run buildDone. Step out from the NextStep directory:
cd ../.. -
Clone this repository:
git clone git@github.com:NextStepFinalProject/NextStep-DevOps.git && NextStep-DevOps -
Setup local deployment via systemd files:
Edit the linux backend service to your environment (i.e. user name, npm path, working directory).
Then, install the backend service:
sudo cp linux/nextstep-backend.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable --now nextstep-backend.service -
Setup nginx configuration:
Edit the nginx.conf file to your environment (i.e. user name, build files path).
Then, add the
nginxuser to thetalgroup:sudo usermod -a -G tal nginxGive execute permissions to
talgroup:chmod g+x /home/tal chmod g+x /home/tal/Code chmod g+x /home/tal/Code/NextStep chmod g+x /home/tal/Code/NextStep/nextstep-frontend chmod -R g+rx /home/tal/Code/NextStep/nextstep-frontend/distConfirm
nginxis in thetalgroup:id nginxTest that the
index.htmlfile can be accesses by thenginxuser:sudo -u nginx cat /home/tal/Code/NextStep/nextstep-frontend/dist/index.htmlApply the configuration, and restart nginx:
sudo cp nginx/nginx.conf /etc/nginx/nginx.conf sudo systemctl restart nginx
-
The nextstep frontend application will be exposed to the world in http://nextstep.theworkpc.com:1785
-
The nextstep backend application will be exposed to the world in http://backend.nextstep.theworkpc.com:1785