Commit bd0ad224 authored by Christophe Benz's avatar Christophe Benz

Add development and production docker-compose files

parent beb4b838
*.secrets.env
\ No newline at end of file
......@@ -6,21 +6,32 @@ Run Validata with Docker.
First install [Docker](https://docs.docker.com/install/) and [docker-compose](https://docs.docker.com/compose/) if not already done.
## Quickstart
## Run on development machine
```bash
git clone https://git.opendatafrance.net/validata/validata-docker.git
cd validata-docker
cd validata-docker/development
docker-compose up -d
```
This will bring up both Validata UI (`http://localhost:5000`) and Validata Web API (`http://localhost:5601`).
This will bring up both Validata UI (`http://localhost:5000`) and Validata Web API (`http://localhost:5001`).
## Environment
Configuration is done by editing environment variables of [./development/docker-compose.yml](development/docker-compose.yml).
TODO
## Deploy to production
`FLASK_ENV` variable is used, it is set by default to `FLASK_ENV=development` for both services.
```bash
git clone https://git.opendatafrance.net/validata/validata-docker.git
cd validata-docker/production
cp api.secrets.env.template api.secrets.env
cp ui.secrets.env.template ui.secrets.env
```
Edit `api.secrets.env` and `ui.secrets.env`. 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.
```bash
docker-compose up -d
```
## See also
......
#!/bin/sh
docker-compose -f docker-compose.dev.yml build --no-cache
docker tag validata-docker_api abulte/validata-api
docker tag validata-docker_ui abulte/validata-ui
docker push abulte/validata-api
docker push abulte/validata-ui
......@@ -2,16 +2,21 @@ version: '3'
services:
api:
# image: git.opendatafrance.net:4567/validata/validata-api:latest
image: validata/api
build:
context: ../../validata-api
ports:
- 5001:5000
environment:
BADGE_CONFIG_URL: https://git.opendatafrance.net/validata/validata-badge/raw/master/badge_conf.toml
ui:
# image: git.opendatafrance.net:4567/validata/validata-ui:latest
image: validata/ui
build:
context: ../../validata-ui
ports:
- 5000:5000
links:
- api
environment:
API_VALIDATE_ENDPOINT: http://api:5000/validate
HOMEPAGE_CONFIG_FILE: homepage_config.json.example
SHIELDS_IO_BASE_URL: https://img.shields.io/
BADGE_CONFIG_URL=https://git.opendatafrance.net/validata/validata-badge/raw/master/badge_conf.toml
LOG_LEVEL=INFO
MATOMO_BASE_URL=https://analytics.validata.fr
MATOMO_SITE_ID=2
SCRIPT_NAME=/api/v1
SECRET_KEY=
MATOMO_AUTH_TOKEN=
version: '3'
services:
reverse-proxy:
image: traefik
restart: always
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.toml:/traefik.toml
- ./acme.json:/acme.json
api:
image: git.opendatafrance.net:4567/validata/validata-api:latest
restart: always
env_file:
- ./api.env
- ./api.secrets.env
labels:
- "traefik.enable=true"
- "traefik.frontend.rule=PathPrefix:/api/v1"
ui:
image: git.opendatafrance.net:4567/validata/validata-ui:latest
restart: always
links:
- api
env_file:
- ./ui.env
- ./ui.secrets.env
labels:
- "traefik.enable=true"
- "traefik.frontend.rule=PathPrefix:/"
debug = false
logLevel = "ERROR"
# defaultEntryPoints = ["https", "http"]
defaultEntryPoints = ["http"]
[entryPoints]
[entryPoints.http]
address = ":80"
# [entryPoints.http.redirect]
# entryPoint = "https"
# permanent = true
# [entryPoints.https]
# address = ":443"
# [entryPoints.https.tls]
[retry]
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "go-next.validata.fr"
watch = true
exposedByDefault = false
# [acme]
# email = "admin-validata@jailbreak.paris"
# storage = "acme.json"
# entryPoint = "https"
# onHostRule = true
# [acme.httpChallenge]
# entryPoint = "http"
API_VALIDATE_ENDPOINT=http://api:5000/validate
HOMEPAGE_CONFIG_FILE=homepage_config.json.example
LOG_LEVEL=INFO
MATOMO_BASE_URL=https://analytics.validata.fr
MATOMO_SITE_ID=1
SHIELDS_IO_BASE_URL=https://img.shields.io/
SECRET_KEY=
MATOMO_AUTH_TOKEN=
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment