Last active
November 19, 2023 09:01
-
-
Save tateg/53ee3072efd1799a3e215a9ebf47e09a to your computer and use it in GitHub Desktop.
Shared Postgres socket for Docker Compose
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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