Files
smalltown/docker-compose.yml
2026-04-26 21:14:44 +08:00

41 lines
1009 B
YAML

version: '3.8'
services:
mysql:
image: mariadb:10.11
container_name: smalltown_mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: smalltown
MYSQL_USER: smalltown
MYSQL_PASSWORD: MyPassword1+
ports:
- "9001:3306"
volumes:
- /home/cui/mysql_data:/var/lib/mysql
- ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 10s
timeout: 5s
retries: 5
smalltown:
build: .
container_name: smalltown_app
restart: always
ports:
- "3001:3000"
environment:
- NODE_ENV=production
- DB_HOST=mysql
- DB_PORT=3306
- DB_USER=smalltown
- DB_PASSWORD=MyPassword1+
- DB_NAME=smalltown
- OSS_URL=http://smalltown.dubaoda.com:9000
- OSS_API_KEY=7cf93760ea49b750c96e6078b364e5f0
depends_on:
mysql:
condition: service_healthy