Skip to content

Instantly share code, notes, and snippets.

@adamu
Last active January 1, 2021 12:39
Show Gist options
  • Select an option

  • Save adamu/e7bab593e4e0f02c5e62634ba0084768 to your computer and use it in GitHub Desktop.

Select an option

Save adamu/e7bab593e4e0f02c5e62634ba0084768 to your computer and use it in GitHub Desktop.
Docker compose file for a simple Postgres server that keeps its state in a Docker volume for persistence between runs.
version: '3.8'
services:
db:
image: postgres
restart: always
ports:
- '5432:5432'
environment:
POSTGRES_PASSWORD: postgres
volumes:
- type: volume
source: postgres_volume
target: /var/lib/postgresql/data
volumes:
postgres_volume:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment