From 127487dc387c012385a3efb358403fc094dc5742 Mon Sep 17 00:00:00 2001 From: sup39 Date: Thu, 18 Jan 2024 04:36:17 +0900 Subject: [PATCH] container: enable pgroonga extension automatically --- dev/Makefile | 5 ----- dev/docker-compose.yml | 2 ++ docker-compose.example.yml | 1 + neko/pgroonga.sql | 1 + 4 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 neko/pgroonga.sql diff --git a/dev/Makefile b/dev/Makefile index 7c644802..7f75b630 100644 --- a/dev/Makefile +++ b/dev/Makefile @@ -10,8 +10,3 @@ down: .PHONY: up up: podman-compose up --detach - sleep 2 - podman-compose exec db psql \ - --user=firefish \ - --dbname=firefish_db \ - --command='CREATE EXTENSION pgroonga;' diff --git a/dev/docker-compose.yml b/dev/docker-compose.yml index 8059ab14..4c616147 100644 --- a/dev/docker-compose.yml +++ b/dev/docker-compose.yml @@ -14,3 +14,5 @@ services: - "POSTGRES_DB=firefish_db" ports: - "5432:5432" + volumes: + - "../neko/pgroonga.sql:/docker-entrypoint-initdb.d/pgroonga.sql:ro" diff --git a/docker-compose.example.yml b/docker-compose.example.yml index fbad1f21..91b3a7d9 100644 --- a/docker-compose.example.yml +++ b/docker-compose.example.yml @@ -40,6 +40,7 @@ services: - .config/docker.env volumes: - ./db:/var/lib/postgresql/data + - ./neko/pgroonga.sql:/docker-entrypoint-initdb.d/pgroonga.sql:ro networks: calcnet: diff --git a/neko/pgroonga.sql b/neko/pgroonga.sql new file mode 100644 index 00000000..11418be3 --- /dev/null +++ b/neko/pgroonga.sql @@ -0,0 +1 @@ +CREATE EXTENSION pgroonga;