changed structure of codebase. also include docker files for easy deployment
46 lines
1.1 KiB
YAML
46 lines
1.1 KiB
YAML
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
|
|
ports:
|
|
- "3306:3306"
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-puta", "--password=uta123"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
uta-sync:
|
|
build: .
|
|
container_name: uta-sync
|
|
ports:
|
|
- "1001:1001"
|
|
restart: unless-stopped
|
|
environment:
|
|
- DATABASE_URL=mysql://uta:uta123@uta-mysql:3306/uta
|
|
- HEALTH_PORT=3000
|
|
- NODE_ENV=production
|
|
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:
|