64 lines
1.4 KiB
YAML
64 lines
1.4 KiB
YAML
# Demo: Portfolio Site
|
|
# Astro + Hono frontend and API consuming shared Directus infrastructure
|
|
|
|
services:
|
|
# Hono API Backend
|
|
api:
|
|
build:
|
|
context: ./api
|
|
dockerfile: Dockerfile
|
|
restart: unless-stopped
|
|
|
|
environment:
|
|
# Connect to external Directus infrastructure
|
|
DIRECTUS_URL: ${DIRECTUS_URL}
|
|
PORT: 3000
|
|
|
|
expose:
|
|
- "3000"
|
|
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e", "require('http').get('http://127.0.0.1:3000/health', (r) => r.statusCode === 200 ? process.exit(0) : process.exit(1))"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
networks:
|
|
- portfolio
|
|
|
|
# Astro Frontend
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
restart: unless-stopped
|
|
|
|
depends_on:
|
|
api:
|
|
condition: service_healthy
|
|
|
|
environment:
|
|
# Internal API URL (within Docker network)
|
|
API_URL: http://api:3000
|
|
# Public API URL (for browser requests)
|
|
PUBLIC_API_URL: ${PUBLIC_API_URL}
|
|
|
|
expose:
|
|
- "4321"
|
|
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e", "require('http').get('http://127.0.0.1:4321/', (r) => r.statusCode === 200 ? process.exit(0) : process.exit(1))"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
networks:
|
|
- portfolio
|
|
|
|
networks:
|
|
portfolio:
|
|
name: portfolio
|
|
external: false
|