infra: .dockerignore, remove exposed port, healthcheck, pin caddy
- add repo-root .dockerignore (target, node_modules, .git, dist) - colony: expose instead of ports (internal network only) - colony: healthcheck via /api/health - caddy: pin to 2.11, mount Caddyfile read-only - caddy: depends_on service_healthy Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
9
.dockerignore
Normal file
9
.dockerignore
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
target/
|
||||||
|
**/node_modules/
|
||||||
|
**/dist/
|
||||||
|
.git/
|
||||||
|
*.db
|
||||||
|
*.db-wal
|
||||||
|
*.db-shm
|
||||||
|
.claude/
|
||||||
|
docs/
|
||||||
@@ -9,23 +9,30 @@ services:
|
|||||||
- DATABASE_URL=sqlite:/data/colony.db?mode=rwc
|
- DATABASE_URL=sqlite:/data/colony.db?mode=rwc
|
||||||
volumes:
|
volumes:
|
||||||
- colony_data:/data
|
- colony_data:/data
|
||||||
ports:
|
# No ports exposed — Caddy reverse proxies on internal network
|
||||||
- "3001:3001"
|
expose:
|
||||||
|
- "3001"
|
||||||
restart: always
|
restart: always
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "curl", "-f", "http://localhost:3001/api/health"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 3s
|
||||||
|
retries: 3
|
||||||
|
|
||||||
caddy:
|
caddy:
|
||||||
image: caddy:latest
|
image: caddy:2.11
|
||||||
container_name: colony-caddy
|
container_name: colony-caddy
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
- "443:443"
|
- "443:443"
|
||||||
volumes:
|
volumes:
|
||||||
- ./Caddyfile:/etc/caddy/Caddyfile
|
- ./Caddyfile:/etc/caddy/Caddyfile:ro
|
||||||
- caddy_data:/data
|
- caddy_data:/data
|
||||||
- caddy_config:/config
|
- caddy_config:/config
|
||||||
restart: always
|
restart: always
|
||||||
depends_on:
|
depends_on:
|
||||||
- colony
|
colony:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
colony_data:
|
colony_data:
|
||||||
|
|||||||
Reference in New Issue
Block a user