Initial commit
This commit is contained in:
commit
e906638173
11 changed files with 169 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/.env
|
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
[submodule "bottin-agenda"]
|
||||
path = bottin-agenda
|
||||
url = https://git.agecem.com/agecem/bottin-agenda
|
||||
[submodule "bottin"]
|
||||
path = bottin
|
||||
url = https://git.agecem.com/agecem/bottin
|
64
README.md
Normal file
64
README.md
Normal file
|
@ -0,0 +1,64 @@
|
|||
# agecem/agenda
|
||||
|
||||
Déploiement monolithique de [bottin](https://git.agecem.com/agecem/bottin) et [bottin-agenda](https://git.agecem.com/agecem/bottin-agenda) par docker-compose
|
||||
|
||||
Pour cloner le repo avec les submodules:
|
||||
|
||||
```sh
|
||||
git clone https://git.agecem.com/agecem/agenda --recurse-submodules
|
||||
```
|
||||
|
||||
Si le repo a été cloné sans `--recurse-submodules`:
|
||||
|
||||
```sh
|
||||
git submodule update --remote --recursive
|
||||
```
|
||||
|
||||
## quickstart
|
||||
|
||||
Instructions pour déployer un environnement avec les fichiers de config d'exemples.
|
||||
|
||||
En production, ne pas oublier de changer les clés API et les credentials de Basic Authentication et de database.
|
||||
|
||||
### Configurer les containers postgresql par variables d'environnement
|
||||
|
||||
En production, modifier le contenu de `.env` et ajuster les fichiers de config en conséquent.
|
||||
|
||||
```sh
|
||||
umask 077
|
||||
cp examples/test.env .env
|
||||
```
|
||||
|
||||
### Démarrer les containers
|
||||
|
||||
*À noter que les containers risquent de restart continuellement tant que l'étape de déploiement de configurations n'est pas accomplie*
|
||||
|
||||
```sh
|
||||
docker-compose up -d --build
|
||||
```
|
||||
|
||||
### Déployer configurations
|
||||
Sur une installation `docker` par défaut, remplir les named volumes:
|
||||
|
||||
*requiert permissions d'écriture, `sudo` peut être nécessaire*
|
||||
|
||||
```sh
|
||||
cp examples/bottin-api.yaml /var/lib/docker/volumes/agenda_bottin_api-config/_data/api.yaml
|
||||
cp examples/bottin-web.yaml /var/lib/docker/volumes/agenda_bottin_web-config/_data/web.yaml
|
||||
cp examples/bottin-agenda-api.yaml /var/lib/docker/volumes/agenda_bottin-agenda_api-config/_data/api.yaml
|
||||
cp examples/bottin-agenda-web.yaml /var/lib/docker/volumes/agenda_bottin-agenda_web-config/_data/web.yaml
|
||||
```
|
||||
|
||||
### Valider le déploiement
|
||||
|
||||
Tous les containers doivent être `Up` lors d'un appel de:
|
||||
|
||||
```sh
|
||||
docker-compose ps
|
||||
```
|
||||
|
||||
Si ce n'est pas le cas, vérifier les logs par:
|
||||
|
||||
```sh
|
||||
docker-compose logs -f
|
||||
```
|
1
bottin
Submodule
1
bottin
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 357c871720568c8eafa5c50365d9505c131b7476
|
1
bottin-agenda
Submodule
1
bottin-agenda
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 44e936cd33004fb45f453c6a541514f31e4a1fb0
|
77
docker-compose.yaml
Normal file
77
docker-compose.yaml
Normal file
|
@ -0,0 +1,77 @@
|
|||
services:
|
||||
|
||||
bottin_db:
|
||||
image: 'docker.io/library/postgres:14.8'
|
||||
environment:
|
||||
POSTGRES_DATABASE: "${BOTTIN_POSTGRES_DATABASE}"
|
||||
POSTGRES_PASSWORD: "${BOTTIN_POSTGRES_PASSWORD}"
|
||||
POSTGRES_USER: "${BOTTIN_POSTGRES_USER}"
|
||||
volumes:
|
||||
- 'bottin_db-data:/var/lib/postgresql/data'
|
||||
restart: 'unless-stopped'
|
||||
|
||||
bottin_api:
|
||||
depends_on:
|
||||
- 'bottin_db'
|
||||
build: './bottin'
|
||||
image: 'git.agecem.com/agecem/bottin:latest'
|
||||
ports:
|
||||
- '1312:1312'
|
||||
volumes:
|
||||
- 'bottin_api-config:/etc/bottin'
|
||||
restart: 'unless-stopped'
|
||||
command: ['bottin', '--config', '/etc/bottin/api.yaml', 'api']
|
||||
|
||||
bottin_web:
|
||||
depends_on:
|
||||
- 'bottin_api'
|
||||
build: './bottin'
|
||||
image: 'git.agecem.com/agecem/bottin:latest'
|
||||
ports:
|
||||
- '2312:2312'
|
||||
volumes:
|
||||
- 'bottin_web-config:/etc/bottin'
|
||||
restart: 'unless-stopped'
|
||||
command: ['bottin', '--config', '/etc/bottin/web.yaml', 'web']
|
||||
|
||||
bottin_agenda_db:
|
||||
image: 'docker.io/library/postgres:15.4'
|
||||
environment:
|
||||
POSTGRES_DATABASE: "${BOTTINAGENDA_POSTGRES_DATABASE}"
|
||||
POSTGRES_PASSWORD: "${BOTTINAGENDA_POSTGRES_PASSWORD}"
|
||||
POSTGRES_USER: "${BOTTINAGENDA_POSTGRES_USER}"
|
||||
volumes:
|
||||
- 'bottin-agenda_db-data:/var/lib/postgresql/data'
|
||||
restart: 'unless-stopped'
|
||||
|
||||
bottin_agenda_api:
|
||||
depends_on:
|
||||
- 'bottin_agenda_db'
|
||||
build: './bottin-agenda'
|
||||
image: 'git.agecem.com/agecem/bottin-agenda:latest'
|
||||
ports:
|
||||
- '1313:1313'
|
||||
volumes:
|
||||
- 'bottin-agenda_api-config:/etc/bottin-agenda'
|
||||
restart: 'unless-stopped'
|
||||
command: ['bottin-agenda', '--config', '/etc/bottin-agenda/api.yaml', 'api']
|
||||
|
||||
bottin_agenda_web:
|
||||
depends_on:
|
||||
- 'bottin_agenda_api'
|
||||
build: './bottin-agenda'
|
||||
image: 'git.agecem.com/agecem/bottin-agenda:latest'
|
||||
ports:
|
||||
- '2313:2313'
|
||||
volumes:
|
||||
- 'bottin-agenda_web-config:/etc/bottin-agenda'
|
||||
restart: 'unless-stopped'
|
||||
command: ['bottin-agenda', '--config', '/etc/bottin-agenda/web.yaml', 'web']
|
||||
|
||||
volumes:
|
||||
bottin_db-data:
|
||||
bottin_api-config:
|
||||
bottin_web-config:
|
||||
bottin-agenda_db-data:
|
||||
bottin-agenda_api-config:
|
||||
bottin-agenda_web-config:
|
5
examples/bottin-agenda-api.yaml
Normal file
5
examples/bottin-agenda-api.yaml
Normal file
|
@ -0,0 +1,5 @@
|
|||
bottin:
|
||||
api:
|
||||
host: 'bottin_api'
|
||||
db:
|
||||
host: 'bottin_agenda_db'
|
3
examples/bottin-agenda-web.yaml
Normal file
3
examples/bottin-agenda-web.yaml
Normal file
|
@ -0,0 +1,3 @@
|
|||
web:
|
||||
api:
|
||||
host: 'bottin_agenda_api'
|
2
examples/bottin-api.yaml
Normal file
2
examples/bottin-api.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
db:
|
||||
host: 'bottin_db'
|
3
examples/bottin-web.yaml
Normal file
3
examples/bottin-web.yaml
Normal file
|
@ -0,0 +1,3 @@
|
|||
web:
|
||||
api:
|
||||
host: 'bottin_api'
|
6
examples/test.env
Normal file
6
examples/test.env
Normal file
|
@ -0,0 +1,6 @@
|
|||
BOTTINAGENDA_POSTGRES_DATABASE=bottin-agenda
|
||||
BOTTINAGENDA_POSTGRES_PASSWORD=bottin-agenda
|
||||
BOTTINAGENDA_POSTGRES_USER=bottin-agenda
|
||||
BOTTIN_POSTGRES_PASSWORD=bottin
|
||||
BOTTIN_POSTGRES_USER=bottin
|
||||
BOTTIN_POSTGRES_DATABASE=bottin
|
Loading…
Reference in a new issue