Интернет-магазин: Go, PostgreSQL 17 SSL, Caddy, Docker Compose

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
shop
2026-05-16 17:09:27 +03:00
commit 448cf2a465
21 changed files with 1208 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
#!/bin/sh
set -e
DIR="${1:-/certs}"
CRT="$DIR/server.crt"
KEY="$DIR/server.key"
if [ -f "$CRT" ] && [ -f "$KEY" ]; then
echo "SSL certificates already exist in $DIR"
exit 0
fi
mkdir -p "$DIR"
openssl req -new -x509 -days 825 -nodes -text \
-out "$CRT" \
-keyout "$KEY" \
-subj "/CN=postgres.shop.local"
chmod 600 "$KEY"
chmod 644 "$CRT"
# postgres image runs as uid 999
chown 999:999 "$KEY" "$CRT" 2>/dev/null || true
echo "Generated PostgreSQL SSL certificates in $DIR"