Skip to content

Commit

Permalink
Add docker-compose file to run PostgreSQL locally (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfvanek authored Apr 13, 2024
1 parent 3955836 commit 72bbc93
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: "3.9"

services:
postgres:
image: postgres:16.1
environment:
POSTGRES_DB: "pgih-db"
POSTGRES_USER: "pgih-db-user"
POSTGRES_PASSWORD: "pgih-db-password"
PGDATA: "/var/lib/postgresql/data/pgdata"
volumes:
- pgih-db-data:/var/lib/postgresql/data
ports:
- "6432:5432"

volumes:
pgih-db-data:
29 changes: 29 additions & 0 deletions docker/local_development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Run PostgreSQL in Docker for local development

## Docker Compose

### Start

```shell
docker-compose --project-name="pgih-db" up -d
```

### Stop

```shell
docker-compose --project-name="pgih-db" down
```

## Explore volumes

### List all volumes

```shell
docker volume ls
```

### Delete specified volume

```shell
docker volume rm pgih-db_pgih-db-data
```

0 comments on commit 72bbc93

Please sign in to comment.