new file: .env.example new file: Dockerfile modified: backend/.env.example modified: backend/package.json renamed: backend/src/migrations/run.ts -> backend/src/scripts/run.ts renamed: backend/src/migrations/seed.ts -> backend/src/scripts/seed.ts new file: docker-compose.external-db.yml new file: docker-compose.yml
64 lines
1.6 KiB
YAML
64 lines
1.6 KiB
YAML
# ============================================
|
|
# KIS API Builder - Docker Compose
|
|
# ============================================
|
|
# Default setup with built-in PostgreSQL
|
|
# Just run: docker compose up -d
|
|
#
|
|
# For external database, use:
|
|
# docker compose -f docker-compose.external-db.yml up -d
|
|
# ============================================
|
|
|
|
services:
|
|
# PostgreSQL Database (built-in)
|
|
db:
|
|
image: postgres:16-alpine
|
|
container_name: kis-api-builder-db
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: api_builder
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./backend/src/migrations:/docker-entrypoint-initdb.d:ro
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres -d api_builder"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 10s
|
|
networks:
|
|
- kis-network
|
|
|
|
# Application (Backend + Frontend)
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: kis-api-builder-app
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${APP_PORT:-3000}:3000"
|
|
environment:
|
|
NODE_ENV: production
|
|
PORT: 3000
|
|
DB_HOST: db
|
|
DB_PORT: 5432
|
|
DB_NAME: api_builder
|
|
DB_USER: postgres
|
|
DB_PASSWORD: ${DB_PASSWORD:-postgres}
|
|
JWT_SECRET: ${JWT_SECRET:-change-this-secret-in-production}
|
|
JWT_EXPIRES_IN: ${JWT_EXPIRES_IN:-24h}
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
networks:
|
|
- kis-network
|
|
|
|
volumes:
|
|
postgres_data:
|
|
|
|
networks:
|
|
kis-network:
|
|
driver: bridge
|