final product

This commit is contained in:
2025-12-04 15:37:56 -07:00
parent d9bddd8715
commit 6b746d466f
12 changed files with 399 additions and 348 deletions

View File

@@ -1,45 +1,19 @@
version: '3.9'
services:
uta-mysql:
image: mysql:8.0
container_name: uta-mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: uta123
MYSQL_DATABASE: uta
MYSQL_USER: uta
MYSQL_PASSWORD: uta123
command: --default-authentication-plugin=mysql_native_password
volumes:
- mysql_data:/var/lib/mysql
- ./init-db.sql:/docker-entrypoint-initdb.d/init-db.sql:ro
redis:
image: redis:7-alpine
container_name: my-redis
ports:
- "3306:3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-puta", "--password=uta123"]
interval: 10s
timeout: 5s
retries: 5
- "6379:6379"
restart: unless-stopped
uta-sync:
app:
build: .
container_name: uta-sync
container_name: my-express-app
ports:
- "1001:1001"
restart: unless-stopped
environment:
- DATABASE_URL=mysql://uta:uta123@uta-mysql:3306/uta
- HEALTH_PORT=3000
- NODE_ENV=production
REDIS_HOST: redis
REDIS_PORT: 6379
depends_on:
uta-mysql:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:3000/health"]
interval: 30s
timeout: 15s
retries: 3
volumes:
mysql_data:
- redis