Phase 3: docker-compose for postgres, redis, caddy

This commit is contained in:
Maurycy
2026-05-06 21:31:25 +01:00
parent b196624929
commit 3ce6a04a40
2 changed files with 52 additions and 0 deletions

7
Caddyfile Normal file
View File

@@ -0,0 +1,7 @@
{
local_certs
}
localhost:443 {
reverse_proxy host.docker.internal:3000
}

45
docker-compose.yml Normal file
View File

@@ -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: