-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (49 loc) · 1.59 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
MAKEFLAGS += --silent
d_network=ladesa-net
d_container_app=ladesa-api
compose_options=--file docker-compose.yml -p ladesa-api
setup:
$(shell (cd .; find . -type f -name "*.example" -exec sh -c 'cp -n {} $$(basename {} .example)' \;))
$(shell (bash -c "docker network create $(d_network) &>/dev/null"))
echo "baixando imagens base dos containers (node e postgres), isso pode levar alguns minutos..."
docker compose $(compose_options) build -q
prepare:
docker compose $(compose_options) exec $(d_container_app) bash -c "corepack install && pnpm install";
up:
make setup;
docker compose $(compose_options) up --remove-orphans -d;
make prepare;
up-recreate:
make setup;
docker compose $(compose_options) up --remove-orphans -d --force-recreate;
make prepare;
start:
make setup;
make down;
make up;
docker compose $(compose_options) \
exec \
-u node \
--no-TTY \
-d $(d_container_app) \
bash -c "pnpm install && pnpm run --filter @ladesa-ro/api.service migration:run && pnpm run --filter @ladesa-ro/api.service start:dev" \&;
logs:
make setup;
docker compose $(compose_options) logs -f;
INSIDE_PATH?=./
shell:
make setup;
make up;
docker compose $(compose_options) exec $(d_container_app) bash -c "cd $(INSIDE_PATH); clear; bash";
shell-root:
make setup;
make up;
docker compose $(compose_options) exec -u root $(d_container_app) bash -c "cd $(INSIDE_PATH); clear; bash";
stop:
make setup;
docker compose $(compose_options) stop;
down:
make setup;
docker compose $(compose_options) down --remove-orphans;
cleanup:
docker compose $(compose_options) down --remove-orphans -v;