add docker compose instructions

pull/4/head
Cameron Clough 2022-04-20 19:42:51 +01:00
parent 687fba8a91
commit abc0c5b45a
No known key found for this signature in database
GPG Key ID: BFB3B74B026ED43F
1 changed files with 18 additions and 6 deletions

View File

@ -1,11 +1,12 @@
# User Acceptance Testing (UAT) environnment # User Acceptance Testing (UAT) environment
Hostname: `uat.api.retropilot.org` Hostname: `uat.api.retropilot.org`
## Setup ## Setup
This setup assumes you have `docker` and `docker-compose` installed on your machine, and that you have added the This setup assumes you have `docker` and `docker-compose` installed on your machine, and that you have added the
relevant users to the `docker` group. relevant users to the `docker` group. Instructions given below are an example - you should look to the official
documentation [here for Docker Engine](https://docs.docker.com/engine/install/) and [here for Docker Compose](https://docs.docker.com/compose/install/).
```sh ```sh
# install docker and setup systemd to start it on boot # install docker and setup systemd to start it on boot
@ -15,6 +16,17 @@ sudo systemctl enable docker
# add $USER to the docker group # add $USER to the docker group
sudo usermod -aG docker $USER sudo usermod -aG docker $USER
# logout and back in to see the change
# install docker compose v2 for all users
DOCKER_CONFIG=/usr/local/lib/docker
sudo mkdir -p $DOCKER_CONFIG/cli-plugins
sudo curl -SL https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
sudo chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
# test docker compose
docker compose version
``` ```
Clone the Git repo to `/data/retropilot-server`. We can clone it using the `--shared` argument to allow multiple users Clone the Git repo to `/data/retropilot-server`. We can clone it using the `--shared` argument to allow multiple users
@ -51,16 +63,16 @@ cd environment/uat
cp .env.sample .env cp .env.sample .env
# create the database # create the database
docker-compose up db docker compose up db
# CTRL-C when "database system is ready to accept connections" message appears # CTRL-C when "database system is ready to accept connections" message appears
# allow the API to initialise the database schema # allow the API to initialise the database schema
docker-compose up db api docker compose up db api
# CTRL-C when "RetroPilot Server listening at" message appears # CTRL-C when "RetroPilot Server listening at" message appears
``` ```
To start all the services: To start all the services:
``` ```sh
cd environment/uat cd environment/uat
docker-compose up -d docker compose up -d
``` ```