casualroom/apps/fenghuo/docker/postgres.yml

29 lines
715 B
YAML
Executable File

services:
db:
image: postgres:16-alpine
container_name: postgres
ports:
- '5432:5432'
environment:
- POSTGRES_DB=fenghuo_db
- POSTGRES_USER=insiinc
- POSTGRES_PASSWORD=Letusdoit000
- POSTGRES_INITDB_ARGS=--encoding=UTF-8
volumes:
- ./volumes/postgres/data:/var/lib/postgresql/data
- ./volumes/postgres/init:/docker-entrypoint-initdb.d
healthcheck:
test: ['CMD-SHELL', "sh -c 'pg_isready -U insiinc -d fenghuo_db'"]
interval: 10s
timeout: 3s
retries: 3
start_period: 40s
restart: unless-stopped
networks:
- nice-net
deploy:
resources:
limits:
memory: 1G
cpus: '1.0'