add postgres compose file

This commit is contained in:
dzj 2024-06-13 12:19:39 +08:00
parent c2b1ae92db
commit 4469248acd
1 changed files with 30 additions and 0 deletions

30
compose-postgresql.yml Normal file
View File

@ -0,0 +1,30 @@
version: '3.9'
name: y9-dev-postgres
services:
postgresql:
image: postgres:latest
container_name: pg01
restart: always
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- y9-share-net
ports:
- "5432:5432"
environment:
POSTGRES_USER: 'root'
POSTGRES_PASSWORD: '12345678'
POSTGRES_DB: 'y9_public'
volumes:
- d:/docker-data/postgres:/var/lib/mysql
- d:/docker-config/postgres-init:/docker-entrypoint-initdb.d
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "postgres", "-U", "root" ]
interval: 5s
timeout: 10s
retries: 8
labels:
org.springframework.boot.readiness-check.tcp.disable: true
networks:
y9-share-net:
external: true