30 lines
642 B
YAML
30 lines
642 B
YAML
|
version: '3.7'
|
||
|
services:
|
||
|
pgsql:
|
||
|
container_name: postgres
|
||
|
image: timescale/timescaledb:latest-pg15
|
||
|
restart: always
|
||
|
environment:
|
||
|
- POSTGRES_PASSWORD=password
|
||
|
- POSTGRES_USER=root
|
||
|
- POSTGRES_DB=postgres
|
||
|
volumes:
|
||
|
- /opt/pgsql/data :/var/lib/postgresql/data
|
||
|
ports:
|
||
|
- "5432:5432"
|
||
|
healthcheck:
|
||
|
test: ["CMD-SHELL", "pg_isready -U root -d postgres"]
|
||
|
interval: 10s
|
||
|
timeout: 5s
|
||
|
retries: 5
|
||
|
start_period: 10s
|
||
|
restart: unless-stopped
|
||
|
deploy:
|
||
|
resources:
|
||
|
limits:
|
||
|
cpus: '4'
|
||
|
memory: 16G
|
||
|
|
||
|
networks:
|
||
|
default:
|
||
|
name: databases
|