commit 992997522a2800c883fb191204da6f858651b6e6 Author: aszerW Date: Sun Oct 12 13:34:49 2025 +0800 postgresql docker compose diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5dec016 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,32 @@ +version: '3.8' + +services: + postgres: + image: postgres:15-alpine + container_name: etf_postgres + restart: unless-stopped + environment: + POSTGRES_DB: etf_db + POSTGRES_USER: admin + POSTGRES_PASSWORD: admin + POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C" + ports: + - "5432:5432" + volumes: + - postgres_data:/var/lib/postgresql/data + networks: + - etf_network + healthcheck: + test: ["CMD-SHELL", "pg_isready -U admin -d etf_db"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 30s + +volumes: + postgres_data: + driver: local + +networks: + etf_network: + driver: bridge