-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (42 loc) · 1.35 KB
/
Makefile
File metadata and controls
56 lines (42 loc) · 1.35 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
.PHONY: help up down logs build rebuild ps psql redis-cli migrate migration shell-api shell-web
COMPOSE = docker compose -f infra/docker-compose.yml --env-file infra/.env
help:
@echo "shillscore — make targets"
@echo " up start the stack (postgres, redis, api, worker, web)"
@echo " down stop and remove containers"
@echo " logs tail logs from all services"
@echo " build build images"
@echo " rebuild build --no-cache then up -d"
@echo " ps show service status"
@echo " psql psql shell into postgres"
@echo " redis-cli redis-cli shell into redis"
@echo " migrate apply alembic migrations"
@echo " migration m=<msg> create a new alembic revision"
@echo " shell-api bash inside the api container"
@echo " shell-web sh inside the web container"
up:
$(COMPOSE) up -d
down:
$(COMPOSE) down
logs:
$(COMPOSE) logs -f --tail=200
build:
$(COMPOSE) build
rebuild:
$(COMPOSE) build --no-cache
$(COMPOSE) up -d
ps:
$(COMPOSE) ps
psql:
$(COMPOSE) exec postgres psql -U shillscore -d shillscore
redis-cli:
$(COMPOSE) exec redis redis-cli
migrate:
$(COMPOSE) exec api alembic upgrade head
migration:
@if [ -z "$(m)" ]; then echo "usage: make migration m=\"add foo\""; exit 1; fi
$(COMPOSE) exec api alembic revision -m "$(m)"
shell-api:
$(COMPOSE) exec api bash
shell-web:
$(COMPOSE) exec web sh