Skip to content

Instantly share code, notes, and snippets.

@tateg
Last active November 19, 2023 09:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tateg/53ee3072efd1799a3e215a9ebf47e09a to your computer and use it in GitHub Desktop.
Save tateg/53ee3072efd1799a3e215a9ebf47e09a to your computer and use it in GitHub Desktop.
Shared Postgres socket for Docker Compose
version: '3.5'
services:
postgres:
container_name: postgres
image: postgres:14-bullseye
environment:
POSTGRES_PASSWORD: password
volumes:
- "./postgres/socket:/var/run/postgresql"
app:
container_name: app
image: postgres:12-bullseye
user: postgres
volumes:
- "./postgres/socket:/var/run/postgresql"
entrypoint: ["psql", "-h", "/var/run/postgresql", "-c", "SELECT version()"]
depends_on:
- postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment