-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (41 loc) · 1.31 KB
/
Makefile
File metadata and controls
54 lines (41 loc) · 1.31 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
IMAGE_NAME := choconet-backend:latest
PGDATA_DIR := db-data
REDIS_DATA_DIR := redis-data
DOCKER_COMPOSE := docker compose
.PHONY: up rm rm-with-volumes up-db rm-db rm-backend status
up:
$(DOCKER_COMPOSE) up --detach --force-recreate
up-with-logs:
$(DOCKER_COMPOSE) up --force-recreate
rm:
$(DOCKER_COMPOSE) stop
$(DOCKER_COMPOSE) down --remove-orphans
docker image rm $(IMAGE_NAME) || true
@if [ -d "$(PGDATA_DIR)" ]; then sudo rm -rf $(PGDATA_DIR); fi
rm-with-volumes:
$(DOCKER_COMPOSE) stop
$(DOCKER_COMPOSE) down --remove-orphans --volumes
docker image rm $(IMAGE_NAME) || true
@if [ -d "$(PGDATA_DIR)" ]; then sudo rm -rf $(PGDATA_DIR); fi
@if [ -d "$(REDIS_DATA_DIR)" ]; then sudo rm -rf $(REDIS_DATA_DIR); fi
up-db:
$(DOCKER_COMPOSE) up -d db
rm-db:
$(DOCKER_COMPOSE) stop db
$(DOCKER_COMPOSE) rm -f db
@if [ -d "$(PGDATA_DIR)" ]; then sudo rm -rf $(PGDATA_DIR); fi
up-redis:
$(DOCKER_COMPOSE) up -d redis
rm-redis:
$(DOCKER_COMPOSE) stop redis
$(DOCKER_COMPOSE) rm -f redis
@if [ -d "$(REDIS_DATA_DIR)" ]; then sudo rm -rf $(REDIS_DATA_DIR); fi
rm-backend:
$(DOCKER_COMPOSE) stop backend
$(DOCKER_COMPOSE) rm -f backend
docker image rm $(IMAGE_NAME) || true
@if [ -d "$(PGDATA_DIR)" ]; then sudo rm -rf $(PGDATA_DIR); fi
up-backend:
$(DOCKER_COMPOSE) up -d backend
status:
$(DOCKER_COMPOSE) ps