generated from oleksandr-romashko/goit-pythonweb-hw-08
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
45 lines (34 loc) · 959 Bytes
/
makefile
File metadata and controls
45 lines (34 loc) · 959 Bytes
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
# ----------------------------------
# Makefile for Docker Compose project
# ----------------------------------
COMPOSE=docker compose
BASE_COMPOSE=-f compose.yaml
DEV_COMPOSE=$(BASE_COMPOSE) -f compose.dev.override.yml
PROFILE=--profile tools
.PHONY: dev prod clean logs stop rebuild restart shell migrate
## Run development environment
dev:
$(COMPOSE) $(DEV_COMPOSE) $(PROFILE) up --build
## Run production environment (detached)
prod:
$(COMPOSE) $(BASE_COMPOSE) $(PROFILE) up --build -d
## Stop and remove containers + volumes
clean:
$(COMPOSE) $(PROFILE) down -v
## Show logs
logs:
$(COMPOSE) logs -f
## Stop all containers
stop:
$(COMPOSE) $(PROFILE) down
## Rebuild containers
rebuild:
$(COMPOSE) $(DEV_COMPOSE) $(PROFILE) up --build --force-recreate
## Restart environment
restart: stop dev
## Open API service shell
shell:
$(COMPOSE) exec api sh
## Run alembic migrations
migrate:
$(COMPOSE) exec api poetry run alembic upgrade head