Initial commit
This commit is contained in:
63
docker-compose.yml
Normal file
63
docker-compose.yml
Normal file
@@ -0,0 +1,63 @@
|
||||
# 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
|
||||
Reference in New Issue
Block a user