README.md 1.96 KB
Newer Older
Alexandre Bulté's avatar
Alexandre Bulté committed
1 2
# validata-docker

Christophe Benz's avatar
Update  
Christophe Benz committed
3 4 5 6 7
Run Validata with Docker.

## Requirements

First install [Docker](https://docs.docker.com/install/) and [docker-compose](https://docs.docker.com/compose/) if not already done.
Alexandre Bulté's avatar
Alexandre Bulté committed
8

9
## Run on development machine
Alexandre Bulté's avatar
Alexandre Bulté committed
10

Christophe Benz's avatar
Update  
Christophe Benz committed
11 12
```bash
git clone https://git.opendatafrance.net/validata/validata-docker.git
13
cd validata-docker/development
Christophe Benz's avatar
Update  
Christophe Benz committed
14
docker-compose up -d
Alexandre Bulté's avatar
Alexandre Bulté committed
15 16
```

17
This will bring up both Validata UI (`http://localhost:5000`) and Validata Web API (`http://localhost:5001`).
Alexandre Bulté's avatar
Alexandre Bulté committed
18

19
Configuration is done by editing environment variables of [./development/docker-compose.yml](development/docker-compose.yml).
Alexandre Bulté's avatar
Alexandre Bulté committed
20

21
## Deploy to production
22

23 24
### Install requirements

25
```bash
26 27
cd production
ansible-galaxy install -r requirements.yml
28 29
```

30 31 32
### Install Validata on server

The following depends on your server provider. Here are the instructions used by a server hosted at Scaleway:
33 34

```bash
35 36 37
cd production
export SCW_TOKEN="..." # secret from Jailbrak KeePassX passwords file
ansible-playbook --inventory scaleway_inventory.yml --limit validata-next --user root playbooks/validata.yml
38
```
39

40 41
Then copy [api.secrets.env.template](./production/api.secrets.env.template) and [ui.secrets.env.template](./production/ui.secrets.env.template) to `/etc/docker/compose/validata` on server (removing the `.template` extension), and fill-in the values. Read [validata-api](https://git.opendatafrance.net/validata/validata-api) and [validata-ui](https://git.opendatafrance.net/validata/validata-ui) documentation for more information about environment variables.

42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
### Deploy a new version

To deploy a new version of Validata:

```bash
ssh root@go-next.validata.fr
cd /etc/docker/compose/validata
docker-compose pull
docker-compose up -d
```

Test that it works. To see the logs:

```bash
docker-compose logs
docker-compose logs -f
```

To delete older images (among other things):

```bash
docker system prune
```

Christophe Benz's avatar
Update  
Christophe Benz committed
66
## See also
67

Christophe Benz's avatar
Update  
Christophe Benz committed
68 69
- https://git.opendatafrance.net/validata/validata-ui
- https://git.opendatafrance.net/validata/validata-api