Add some server scripts

This commit is contained in:
Gabriel Augendre 2022-12-16 22:12:15 +01:00
parent 79a670f666
commit 31fa3d44c5
2 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1,20 @@
version: '2.4'
services:
django:
image: crocmagnon/{{cookiecutter.project_slug}}
env_file:
- .env
volumes:
- ./db:/app/db
- ./data:/app/data
networks:
- frontend
user: 1000:1000
restart: always
init: true
tty: true
mem_limit: 512m
networks:
frontend:
external: true

View file

@ -0,0 +1,8 @@
#!/bin/bash
set -euxo pipefail
pushd /mnt/data/{{cookiecutter.project_slug}}
docker compose --ansi never pull --quiet
docker compose --ansi never up -d
docker compose exec django python manage.py migrate
popd
docker image prune -f