Skip to content

Latest commit

 

History

History
149 lines (104 loc) · 3.01 KB

install.md

File metadata and controls

149 lines (104 loc) · 3.01 KB

Fork the project

You must fork the project and create a public project in your gitlab/github account.

Clone the project:

//With a SSH Key
git clone git@github.com:devSpallian/spallian-test.git

OR

git clone https://github.com/devSpallian/spallian-test.git

Link the project to your gitlab/github account:

Create a new public repository in your Gitlab/GitHub account, link the project

git remote set-url origin [url to your gitlab/github project]

Docker Installation

Introduction

Docker is not necessary but recommended https://docs.docker.com/

You can install docker desktop that come with docker compose (v2)

Or install docker engine manually, then install docker-compose (v1) (Linux/Mac)

Install docker engine :

Install docker-compose :

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version

If done correctly, you will see output similar to this:

//Output
docker-compose version 1.29.2, build 5becea4c

Run the project

Do not forget to navigate to the root folder of the project to use these commands.

Depending of your docker installation you must choose between compose v1 or v2

Build the container

Type the following command in a terminal:

// compose v1:
docker-compose build
// OR compose v2:
docker compose build

Run the container (in the background)

Type the following command in a terminal:

//compose v1:
docker-compose up -d
//OR compose v2:  
docker compose up -d

If everything is working you should see the container running using this command:

//compose v1:
docker-compose ps
//OR compose v2:  
docker compose ps

Shutdown the container

Type the following command in a terminal:

//compose v1:
docker-compose down
// OR compose v2:  
docker compose down

Install dependencies

Type the following command in a terminal (the container must be running):

//compose v1:
docker-compose exec app npm install [dependency-name]
// OR compose v2:
docker compose exec app npm install [dependency-name]

Get inside the container

//compose v1:
docker-compose exec app sh
// OR compose v2:
docker compose exec app sh

Run the project without Docker

if for some reason you can't make docker to work, follow these instructions

However, it might not work unless you have the right version of Node

  • Install NodeJs
  • Install npm

Then use the following command inside the project folder to install necessary dependencies:

npm install

Then run the project:

npm run start