This commit is contained in:
2026-01-25 00:24:45 +03:00
parent 1c9bf15e3d
commit 650f9359d8
3 changed files with 44 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
POSTGRES_PASSWORD=SuperStrongPassw0rd
+1
View File
@@ -0,0 +1 @@
.env
+42
View File
@@ -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