Installing exchanger-api / DONE
Prepare dependencies
apt update
apt upgrade -y
apt install -y nano sudo curl wget1. Install Docker and Docker Compose
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh2. Create runner user and add it to sudoers
sudo adduser --disabled-password --gecos "" runner
sudo usermod -aG sudo runner3. Create docker group and add user to it
sudo usermod -aG docker runner4. Switch to a 'runner' user
sudo su runnernewgrp docker5. Create docker network
docker network create --subnet 10.1.0.0/24 exchanger-net6. Docker login
Create a Personal Access Token in GitLab
Make sure to tick the
read_registrypermission scopeCreate a reminder to update the PAT after expiration date, as once it expires you lose access for updates. https://git.boxexchanger.net/-/profile/personal_access_tokens
Login to docker read_registry
docker login rg.boxexchanger.net # Username: your_gitlab_username # Password: your_gitlab_pat
7. Create required folders
8. Create your configurations (.env)
Below example configuration .env
Insert your variables PROJECT_NAME and API_URL
9. Create nginx configuration for api
Create /home/runner/api_server/nginx_api.conf file with following contents
10. Create your docker-compose.yml
Below example of docker compose file where you must change $VCS_NAMESPACE to your git group path for example bx4/project-name
11. Execute credential mongo generation script
12. Initialize MongoDB
13. Start API server
14. Get and remove initial admin credentials:
remove access.txt
1. Preparing the environment
After installing the server, you need to connect to it via SSH and configure the environment
Install server packages (nano git curl)
Install NodeJS:
Installing NodeJs / DONEInstall MongoDB:
MongoDB Installation / DONEInstall Redis
Install g ++ build-essential imagemagick graphicsmagick packages
Install PM2
2. Downloading software to the server
Create an SSH key
Documentation from github.com Creating a new SSH key
Linux tutorial
> Enter x3
Get your key:
Copy the result and install this key in your git.boxexchanger.net account
Access to source code / DONECloning repositories
NAME_SPACE - you can find out in your personal account completely the link to clone the repository.
3. Configuring and running Rest-API
Customise the configuration of your project
Attention! You need to specify your project name, domain name and database accesses: PROJECT_NAME, API_URL, MONGO_URI.
Apply Configuration:
Find the line !!! SAVE !!!, *****@admin.ex ***** Save the data is your admin panel login and password!
Gather API documentation:
Check api:
the answer must contain:
this is "service path" for project ...
Last updated