From 650f9359d85efba8c530d31b7d9ed236a2ec84bc Mon Sep 17 00:00:00 2001 From: Rustavy Zhigulin Date: Sun, 25 Jan 2026 00:24:45 +0300 Subject: [PATCH] init --- .env.template | 1 + .gitignore | 1 + docker-compose.yml | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 .env.template create mode 100644 .gitignore create mode 100644 docker-compose.yml diff --git a/.env.template b/.env.template new file mode 100644 index 0000000..29dabdb --- /dev/null +++ b/.env.template @@ -0,0 +1 @@ +POSTGRES_PASSWORD=SuperStrongPassw0rd diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..71844c6 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,42 @@ +services: + postgres: + image: postgres:16-alpine + container_name: postgres + restart: unless-stopped + environment: + POSTGRES_USER: labuser + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + POSTGRES_DB: labdb + POSTGRES_INITDB_ARGS: "--encoding=UTF8 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8" + networks: + - "net" + ports: + - "5432:5432" + volumes: + - postgres-data:/var/lib/postgresql/data + deploy: + resources: + limits: + cpus: '1.0' + memory: 1G + reservations: + cpus: '0.5' + memory: 512M + healthcheck: + test: ["CMD-SHELL", "pg_isready -U labuser -d labdb"] + interval: 10s + timeout: 5s + retries: 5 + +# Объявляем volumes отдельно (bind-mount) +volumes: + postgres-data: + driver: local + driver_opts: + type: none + device: /mnt/postgres/postgres-data + o: bind + +networks: + net: + external: true