add manuels

This commit is contained in:
Gabriel Augendre 2024-10-11 19:28:57 +02:00
parent b0efecdd53
commit 62b42a9a85
6 changed files with 78 additions and 1 deletions

View file

@ -9,5 +9,6 @@
- import_playbook: gitea.yaml # noqa: name[play]
- import_playbook: goatcounter.yaml # noqa: name[play]
- import_playbook: lyon-transports.yaml # noqa: name[play]
- import_playbook: manuels.yaml # noqa: name[play]
- import_playbook: test_headers.yaml # noqa: name[play]
- import_playbook: wallabag.yaml # noqa: name[play]

View file

@ -0,0 +1,7 @@
#!/bin/bash
set -euxo pipefail
pushd /mnt/data/manuels
docker compose --ansi never pull
docker compose --ansi never up -d
popd
docker image prune -f

View file

@ -0,0 +1,34 @@
---
- name: Manuels
hosts: servers
gather_facts: false
tasks:
- name: Docker
ansible.builtin.include_role:
name: docker
vars:
docker_app_name: manuels
secret_key: !vault |
$ANSIBLE_VAULT;1.1;AES256
64306561643134653031316464326531643532383663343665326331626132313930633031636435
6663383862663966333161356563323035643434303263640a393638393336346138313566663165
63373662376364353335313234396161646466336439306463633238326536643838633735653661
6430346530313939310a363233663934373433656634646335623336353964666539346534393931
39343066343736343831313430346537346437366430643465303130393734646238323465356231
3931363962306337613030663239623536316339303836343530
mailgun_api_key: !vault |
$ANSIBLE_VAULT;1.1;AES256
33656537666436376336653161333165306265623161333430626333633039383433613135383435
6234316438616462663834383363626363643232386363620a323465653063346432303965663831
65396230336134376264303166626638333265633139333230353731363964333434666338386336
3965653834656536340a396239363339663231626635323364636331386330643030346132343035
35623961373734616264636666376464346430613137613438316337636361336434613064366435
3331306630663536343162346235383338366234666333633563
pg_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
62323036653035616437353636363339323162646135613434306366386362643466663163356461
3163613832333865663564373439333866383638643137390a323364616536313465306138666463
65356437313031373736396133383236383763376138383031633365633730646439643863383037
6133316535373830620a373162656264376164396434373064636235613762666361326231653237
35323539613232633037643465636338376531656230646632313533656364653566

View file

@ -3,7 +3,8 @@
hosts: servers
gather_facts: false
tasks:
- include_role:
- name: Docker
ansible.builtin.include_role:
name: docker
vars:

View file

@ -0,0 +1,10 @@
SECRET_KEY='{{ secret_key }}'
DEBUG=true
HOSTS=fournitures.augendre.info,manuels.augendre.info
ADMINS=Gabriel Augendre|gabriel@augendre.info
MAILGUN_API_KEY={{ mailgun_api_key }}
MAILGUN_SENDER_DOMAIN=mg.augendre.info
SERVER_EMAIL=Fournitures et manuels scolaires CDI LPHB <manuels@mg.augendre.info>
LIBRARIAN_EMAILS=sandrine.augendre@ac-lyon.fr
EMAIL_REPLY_TO=Sandrine Augendre <sandrine.augendre@ac-lyon.fr>
DATABASE_URL=postgres://manuels:{{ pg_password }}@db:5432/manuels

View file

@ -0,0 +1,24 @@
services:
django:
image: crocmagnon/manuels-scolaires:latest
env_file:
- .env
volumes:
- ./media:/app/media
depends_on:
- db
restart: always
init: true
tty: true
mem_limit: 512m
ports:
- "8012:8000"
db:
image: postgres:15
restart: always
environment:
POSTGRES_PASSWORD: "{{ pg_password }}"
POSTGRES_USER: "manuels"
POSTGRES_DB: "manuels"
volumes:
- ./db_data:/var/lib/postgresql/data