-
-
Save bit-app-3000/7900b8c4fa7603a9dabde14fe185074f to your computer and use it in GitHub Desktop.
Shared Postgres socket for Docker Compose
This file contains hidden or 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