Initial commit: Project structure and layout
This commit is contained in:
68
docker-compose.yml
Normal file
68
docker-compose.yml
Normal file
@@ -0,0 +1,68 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# Backend Service (NestJS)
|
||||
backend:
|
||||
build:
|
||||
context: ./server
|
||||
dockerfile: Dockerfile.dev
|
||||
container_name: sillytavern-backend
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "23337:3000" # Map to host port 23337
|
||||
volumes:
|
||||
# Mount code for hot reload (development)
|
||||
- ./server:/usr/src/app
|
||||
- ./shared:/usr/src/shared
|
||||
# Exclude node_modules to use container's version
|
||||
- /usr/src/app/node_modules
|
||||
# Persistent data
|
||||
- ./data:/usr/src/app/data
|
||||
- ./.env:/usr/src/app/.env:ro
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
- PORT=3000
|
||||
- DB_DATABASE=./data/db/app.db
|
||||
- UPLOAD_DIR=./data/files
|
||||
- LOG_DIR=./data/logs
|
||||
working_dir: /usr/src/app
|
||||
command: npm run start:dev
|
||||
networks:
|
||||
- app-network
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--spider", "-q", "http://localhost:3000/api"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
||||
# Frontend Service (Vue3 + Vite)
|
||||
frontend:
|
||||
build:
|
||||
context: ./client
|
||||
dockerfile: Dockerfile.dev
|
||||
container_name: sillytavern-frontend
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "23338:5173" # Vite dev server port
|
||||
volumes:
|
||||
# Mount code for hot reload (development)
|
||||
- ./client:/usr/src/app
|
||||
- ./shared:/usr/src/shared
|
||||
# Exclude node_modules
|
||||
- /usr/src/app/node_modules
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
- VITE_API_URL=http://localhost:23337
|
||||
- VITE_WS_URL=ws://localhost:23337
|
||||
working_dir: /usr/src/app
|
||||
command: npm run dev -- --host 0.0.0.0 --port 5173
|
||||
depends_on:
|
||||
backend:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
networks:
|
||||
app-network:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user