dev: keep db/redis data on db.down
This commit is contained in:
parent
d9ee4737bc
commit
9b354790c3
3 changed files with 16 additions and 5 deletions
6
Makefile
6
Makefile
|
@ -27,13 +27,13 @@ build:
|
|||
pnpm run migrate
|
||||
|
||||
|
||||
.PHONY: db.init db.up db.down
|
||||
db.init:
|
||||
$(MAKE) -C ./dev/db-container init
|
||||
.PHONY: db.up db.down db.init
|
||||
db.up:
|
||||
$(MAKE) -C ./dev/db-container up
|
||||
db.down:
|
||||
$(MAKE) -C ./dev/db-container down
|
||||
db.init:
|
||||
$(MAKE) -C ./dev/db-container init
|
||||
|
||||
.PHONY: psql redis-cli
|
||||
psql:
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
.PHONY: init up down
|
||||
init: down up
|
||||
.PHONY: up down init
|
||||
up:
|
||||
$(COMPOSE) up --detach
|
||||
down:
|
||||
$(COMPOSE) down
|
||||
init:
|
||||
$(COMPOSE) down --volumes
|
||||
$(COMPOSE) up --detach
|
||||
|
||||
.PHONY: psql redis-cli
|
||||
psql:
|
||||
|
|
|
@ -5,6 +5,8 @@ services:
|
|||
image: docker.io/redis:7-alpine
|
||||
ports:
|
||||
- "26379:6379"
|
||||
volumes:
|
||||
- "redis-data:/data"
|
||||
db:
|
||||
image: docker.io/groonga/pgroonga:3.1.8-alpine-12
|
||||
env_file:
|
||||
|
@ -13,3 +15,10 @@ services:
|
|||
- "25432:5432"
|
||||
volumes:
|
||||
- "./install.sql:/docker-entrypoint-initdb.d/install.sql:ro"
|
||||
- "postgres-data:/var/lib/postgresql/data"
|
||||
|
||||
volumes:
|
||||
redis-data:
|
||||
name: redis-data
|
||||
postgres-data:
|
||||
name: postgres-data
|
||||
|
|
Loading…
Reference in a new issue