- create
docker-compose.yml
file - create
database/postgres/docker-entrypoint-initdb
folder - create
database/postgres/docker-entrypoint-initdb/extension.sql
file
Last active
November 6, 2024 00:24
-
-
Save ynwd/f39c78fc4c62b0116425f333be2b9f77 to your computer and use it in GitHub Desktop.
postgres uuid extension in 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.8" | |
services: | |
redis: | |
image: "redis:alpine" | |
ports: | |
- '6379:6379' | |
db: | |
image: postgres:12.2 | |
environment: | |
POSTGRES_DB: postgres | |
POSTGRES_USER: admin | |
POSTGRES_PASSWORD: secret | |
volumes: | |
- ./database/postgres/docker-entrypoint-initdb:/docker-entrypoint-initdb.d/ | |
ports: | |
- "5432:5432" | |
adminer: | |
image: adminer | |
restart: always | |
ports: | |
- 8080:8080 |
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
CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment