Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localのdocker環境で、postgresが立ち上がらない問題の修正 #623

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Loading