version: "3.7"
services:
db:
image: postgres:alpine
restart: always
volumes:
- db_data:/var/lib/postgresql/data
# - ./init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "5432:5432"
# env_file:
# - .env
environment:
# default user name: postgres
# - POSTGRES_USER=postgres
- POSTGRES_PASSWORD=123456
# - POSTGRES_DB=postgres
- TZ=Asia/Shanghai
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5m
timeout: 5s
retries: 3
# start_period: 1m
adminer:
image: adminer
restart: always
ports:
- "8080:8080"
volumes:
db_data: