From 3ce6a04a40bf3d809380456aea45bb264308680d Mon Sep 17 00:00:00 2001 From: Maurycy Date: Wed, 6 May 2026 21:31:25 +0100 Subject: [PATCH] Phase 3: docker-compose for postgres, redis, caddy --- Caddyfile | 7 +++++++ docker-compose.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 Caddyfile create mode 100644 docker-compose.yml diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..7efe05f --- /dev/null +++ b/Caddyfile @@ -0,0 +1,7 @@ +{ + local_certs +} + +localhost:443 { + reverse_proxy host.docker.internal:3000 +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..4a26172 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,45 @@ +services: + postgres: + image: postgres:16-alpine + environment: + POSTGRES_USER: fog + POSTGRES_PASSWORD: fog_dev + POSTGRES_DB: fog_expedition + ports: + - "5432:5432" + volumes: + - postgres_data:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U fog -d fog_expedition"] + interval: 5s + timeout: 5s + retries: 10 + + redis: + image: redis:7-alpine + ports: + - "6379:6379" + volumes: + - redis_data:/data + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 5s + timeout: 5s + retries: 10 + + caddy: + image: caddy:2-alpine + ports: + - "443:443" + volumes: + - ./Caddyfile:/etc/caddy/Caddyfile:ro + - caddy_data:/data + - caddy_config:/config + extra_hosts: + - "host.docker.internal:host-gateway" + +volumes: + postgres_data: + redis_data: + caddy_data: + caddy_config: