Skip to content

Commit

Permalink
Merge pull request codeforjapan#623 from ayuki-joto/fix/docker-postgres
Browse files Browse the repository at this point in the history
localのdocker環境で、postgresが立ち上がらない問題の修正
  • Loading branch information
ayuki-joto authored Aug 5, 2024
2 parents 64066f6 + 287786f commit acd4dca
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 acd4dca

Please sign in to comment.