Initial scaffold: FastAPI micro-service with Docker, SQLite, tests
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
services:
|
||||
api:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: micro-api
|
||||
ports:
|
||||
- "${API_PORT:-8000}:8000"
|
||||
environment:
|
||||
- DEBUG=${DEBUG:-false}
|
||||
- DATABASE_URL=${DATABASE_URL:-sqlite:///data/app.db}
|
||||
volumes:
|
||||
- api_data:/app/data
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health')"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
|
||||
volumes:
|
||||
api_data:
|
||||
driver: local
|
||||
Reference in New Issue
Block a user