-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (25 loc) · 961 Bytes
/
Copy pathMakefile
File metadata and controls
29 lines (25 loc) · 961 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
# --build rebuilds images before starting the containers
# TODO: REMOVE THE --detach AND --remove-orphans BEFORE HANDING IN
.PHONY: up
up:
docker-compose up --build
.PHONY: down
down:
docker compose down
# $$ is an escaped $, and it gives sh, rather than Make, the chance to expand it
# 2> /dev/null ignores errors when $$(docker ps -qa) expands to an empty result
# Likewise, || exit 0 makes sure Make doesn't report an error
.PHONY: clean
clean: rmvol
docker stop $$(docker ps -qa) 2> /dev/null || exit 0
docker rm $$(docker ps -qa) 2> /dev/null || exit 0
docker rmi -f $$(docker images -qa) 2> /dev/null || exit 0
docker network rm $$(docker network ls -q) 2> /dev/null || exit 0
docker builder prune -f
.PHONY: rmvol
rmvol: down
find containers/nestjs/profile_pictures -type f ! -name 42 -delete
docker volume rm $$(docker volume ls -q) 2> /dev/null || exit 0
.PHONY: test
test:
docker compose exec --workdir /nestjs/code/ nestjs npm run test