Skip to content

Commit

Permalink
fix: local docker postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
ayuki-joto committed Aug 5, 2024
1 parent 64066f6 commit 287786f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.8"

x-custom:
app:
- &rails_env "development"
Expand Down Expand Up @@ -45,7 +43,9 @@ services:
links:
- pg
pg:
image: postgres:12
image: postgres
build:
context: docker/postgres/.
volumes:
- pg-data:/var/lib/postgresql/data
environment:
Expand Down
15 changes: 15 additions & 0 deletions docker/postgres/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM postgres:12

RUN apt update
RUN apt install -y postgresql-server-dev-12 make gcc curl libicu-dev

RUN cd /tmp && \
curl -L -O https://github.com/pgbigm/pg_bigm/archive/refs/tags/v1.2-20240606.tar.gz && \
tar zxf v1.2-20240606.tar.gz && \
cd pg_bigm-1.2-20240606 && \
make USE_PGXS=1 && \
make USE_PGXS=1 install && \
rm -rf /tmp/pg_bigm-1.2-20240606 /tmp/v1.2-20240606.tar.gz

RUN mkdir -p /docker-entrypoint-initdb.d
COPY ./initdb-pg_bigm.sql /docker-entrypoint-initdb.d/10_pg_bigm.sql
1 change: 1 addition & 0 deletions docker/postgres/initdb-pg_bigm.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE EXTENSION IF NOT EXISTS pg_bigm;

0 comments on commit 287786f

Please sign in to comment.