-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
117 lines (109 loc) · 3.71 KB
/
Copy pathdocker-compose.yml
File metadata and controls
117 lines (109 loc) · 3.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# LOCALHOST Development Configuration
# Zero external dependencies - works on any laptop
# Features: Embedded MySQL, direct port access, no Traefik required
# Use: docker compose -f docker-compose.local.yml up -d
# Or: ./manage.sh switch local && docker compose up -d
# Access: http://localhost:3000
services:
typus_lite:
container_name: ${COMPOSE_PROJECT_NAME:-typus}_lite
build:
context: .
dockerfile: Dockerfile.prod
restart: unless-stopped
ports:
- "${LOCALHOST_PORT:-3000}:80"
networks:
- typus-local
environment:
# Localhost "zero-config" defaults (no .env required)
- NODE_ENV=development
- SERVER_PORT=3001
- PORT=3001
- HOST=0.0.0.0
- API_PATH=/api
- APP_DOMAIN=localhost
- APP_URL=http://localhost:${LOCALHOST_PORT:-3000}
- BACKEND_URL=http://localhost:${LOCALHOST_PORT:-3000}
- FRONTEND_URL=http://localhost:${LOCALHOST_PORT:-3000}
# Required secrets/tokens (LOCAL ONLY; do not use for production)
- INTERNAL_API_TOKEN=local_dev_internal_token_change_me
- APP_SECRET=local_dev_app_secret_change_me
- JWT_SECRET=local_dev_jwt_secret_change_me
- JWT_EXPIRE=2592000
- REFRESH_TOKEN_EXPIRE=2592000
- SESSION_SECRET=local_dev_session_secret_change_me
- CONVERSATION_ENCRYPTION_SALT=local_dev_conversation_salt_change_me
# Default admin (LOCAL ONLY)
- ADMIN_EMAIL=admin@localhost
- ADMIN_PASSWORD=admin12345
# Embedded MySQL (service "mysql" below)
- DB_PROVIDER=mysql
- DB_HOST=mysql
- DB_PORT=3306
- DB_NAME=typus_db
- DB_USER=${DB_USER:-typus}
- DB_PASSWORD=${DB_PASSWORD:-typus_password}
- REDIS_ENABLED=false
- DISPATCHER_ENABLED=false
- PROJECT_PATH=/app
- STORAGE_PATH=/app/storage
- UPLOADS_PATH=/app/storage/uploads
volumes:
# Application code (no bind mounts in packaged release)
- storage:/app/storage
- logs:/app/logs
- nginx-logs:/var/log/nginx
depends_on:
mysql:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
mysql:
image: mysql:8.0
container_name: ${COMPOSE_PROJECT_NAME:-typus}_mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root_secret}
# Fixed database name to avoid conflicts with SQLite file paths in DB_NAME
MYSQL_DATABASE: typus_db
MYSQL_USER: ${DB_USER:-typus}
MYSQL_PASSWORD: ${DB_PASSWORD:-typus_password}
volumes:
- mysql-data:/var/lib/mysql
# Optional: Custom MySQL configuration
- ./docker/mysql/my.cnf/custom.cnf:/etc/mysql/conf.d/custom.cnf:ro
networks:
- typus-local
# MySQL is not published to host by default (avoids port conflicts).
# App connects via service name `mysql` inside the Docker network.
# To expose MySQL for local debugging, add:
# ports:
# - "3307:3306"
healthcheck:
test: ["CMD-SHELL", "MYSQL_PWD=$$MYSQL_ROOT_PASSWORD mysqladmin ping -h localhost -u root"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --default-authentication-plugin=mysql_native_password
networks:
typus-local:
driver: bridge
name: ${COMPOSE_PROJECT_NAME:-typus}_local_network
volumes:
storage:
name: ${COMPOSE_PROJECT_NAME:-typus}_storage
mysql-data:
name: ${COMPOSE_PROJECT_NAME:-typus}_mysql_data
logs:
name: ${COMPOSE_PROJECT_NAME:-typus}_logs
nginx-logs:
name: ${COMPOSE_PROJECT_NAME:-typus}_nginx_logs