-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
32 lines (25 loc) · 1.35 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
include .env
DB_CONTAINER_ID := $(shell docker compose ps -q db)
deploy-front:
cd frontend && REACT_APP_ENV=production yarn build
rsync -avz ./frontend/build/ vps:/home/fouc/passe-un-dessin/build
deploy-back:
cd backend && docker build -f ./docker/Dockerfile.prod . -t foucdeg/passe-un-dessin:latest
docker push foucdeg/passe-un-dessin:latest
deploy-drawing-renderer:
cd drawing-renderer && docker build -f ./Dockerfile.prod . -t foucdeg/passe-un-dessin-drawing-renderer:latest
docker push foucdeg/passe-un-dessin-drawing-renderer:latest
deploy: deploy-back deploy-front
load_prod_dump:
# the above is run in a cron job, uncomment if you need the freshest data
# ssh vps "PGPASSWORD=$(DB_PASSWORD) pg_dump -U passe_un_dessin_user -d passe_un_dessin -c -f /tmp/dump.pgbackup"
scp vps:/tmp/dump.pgbackup /tmp/dump.pgbackup
docker cp /tmp/dump.pgbackup $(DB_CONTAINER_ID):/tmp/dump.pgbackup
docker compose exec db psql -U postgres -d postgres -f /tmp/dump.pgbackup
docker compose exec backend ./manage.py migrate django_eventstream zero
docker compose exec backend ./manage.py migrate django_eventstream
frontend/localhost-key.pem:
mkcert -cert-file frontend/localhost.pem -key-file frontend/localhost-key.pem localhost
certs: frontend/localhost-key.pem
cp frontend/localhost.pem pushpin/localhost.pem
cp frontend/localhost-key.pem pushpin/localhost-key.pem