diff --git a/README.md b/README.md index 3f5a0fd..8ec7557 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,6 @@ A collection of Docker infrastructure files for quick deployment of development services. -## Contents - -- **`compose/`** — Docker Compose files for various services - - [`sql-server-2025`](compose/sql-server-2025/) — Microsoft SQL Server 2025 -- **`get-docker.sh`** — Docker Engine installation script for Linux, synchronised - weekly from upstream - ## Usage Each service lives under its own directory within `compose/`. Copy the diff --git a/compose/postgres/.env.example b/compose/postgres/.env.example new file mode 100644 index 0000000..48e1378 --- /dev/null +++ b/compose/postgres/.env.example @@ -0,0 +1,13 @@ +# PostgreSQL (Alpine) — environment variables +# Copy this file to .env and adjust values for your environment. + +# Superuser name (default: postgres). +POSTGRES_USER=postgres + +# Superuser password. +# The default is for local development only — always change for production. +POSTGRES_PASSWORD=postgres + +# Default database created automatically on first start. +# Defaults to the value of POSTGRES_USER if not set. +POSTGRES_DB=postgres diff --git a/compose/postgres/docker-compose.yaml b/compose/postgres/docker-compose.yaml new file mode 100644 index 0000000..de3f171 --- /dev/null +++ b/compose/postgres/docker-compose.yaml @@ -0,0 +1,33 @@ +# Docker Compose file for PostgreSQL (Alpine) +# +# Usage: +# docker compose up -d +# +# Environment variables (see .env.example for details): +# POSTGRES_USER - Superuser name (default: postgres) +# POSTGRES_PASSWORD - Superuser password (default: postgres) +# POSTGRES_DB - Default database created on first start (default: postgres) + +services: + postgres: + # For available image tags, see https://hub.docker.com/_/postgres + image: postgres:18-alpine + container_name: postgres + environment: + # Superuser name. Defaults to "postgres" if not set. + - POSTGRES_USER=${POSTGRES_USER:-postgres} + # Superuser password. + # Default value is for local development only — change for production. + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres} + # Database created automatically on first start. + # Defaults to the value of POSTGRES_USER if not set. + - POSTGRES_DB=${POSTGRES_DB:-postgres} + ports: + # Map host port 5432 to container port 5432 (PostgreSQL default). + - "5432:5432" + volumes: + # Persist data beyond container lifetime. + - postgres_data:/var/lib/postgresql/data + +volumes: + postgres_data: