67 lines
1.5 KiB
YAML
67 lines
1.5 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
mysql:
|
|
image: mysql:8.0
|
|
container_name: shebeiguanli-mysql
|
|
restart: always
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: jsjj8888
|
|
MYSQL_DATABASE: shebeiguanli
|
|
MYSQL_CHARSET: utf8mb4
|
|
MYSQL_COLLATION: utf8mb4_unicode_ci
|
|
ports:
|
|
- "3307:3306"
|
|
volumes:
|
|
- shebeiguanli-mysql-data:/var/lib/mysql
|
|
command:
|
|
- --default-authentication-plugin=mysql_native_password
|
|
- --character-set-server=utf8mb4
|
|
- --collation-server=utf8mb4_unicode_ci
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-pjsjj8888"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- shebeiguanli-network
|
|
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
container_name: shebeiguanli-backend
|
|
restart: always
|
|
ports:
|
|
- "3001:3000"
|
|
environment:
|
|
DATABASE_URL: mysql://root:jsjj8888@mysql:3306/shebeiguanli?charset=utf8mb4
|
|
SESSION_SECRET: shebeiguanli-secret-key
|
|
AUTH_MODE: local
|
|
PORT: 3000
|
|
depends_on:
|
|
mysql:
|
|
condition: service_healthy
|
|
networks:
|
|
- shebeiguanli-network
|
|
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
container_name: shebeiguanli-frontend
|
|
restart: always
|
|
ports:
|
|
- "8081:80"
|
|
depends_on:
|
|
- backend
|
|
networks:
|
|
- shebeiguanli-network
|
|
|
|
volumes:
|
|
shebeiguanli-mysql-data:
|
|
|
|
networks:
|
|
shebeiguanli-network:
|
|
driver: bridge
|