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

Added postgis plugin into postgres docker image for local development #269

Merged
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
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ services:
volumes:
- db-mongo:/data/db
db-postgres:
image: postgres:15-alpine
build:
dockerfile: docker-resources/postgres/Dockerfile.dev
ports:
- "${POSTGRES_PORT:-5432}:5432"
environment:
Expand Down
8 changes: 8 additions & 0 deletions docker-resources/postgres/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Use the official PostgreSQL image as the base image
FROM postgres:15

# Install PostGIS extension
RUN apt-get update && apt-get install -y postgresql-15-postgis-3

# Copy a script to activate PostGIS
COPY docker-resources/postgres/init-postgis.sh /docker-entrypoint-initdb.d
5 changes: 5 additions & 0 deletions docker-resources/postgres/init-postgis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -e

echo "Activating PostGIS extension..."
psql -U $POSTGRES_USER -d $POSTGRES_DB -c "CREATE EXTENSION postgis;"
Loading