diff --git a/.gitea/workflows/deploy-demo.yaml b/.gitea/workflows/deploy-demo.yaml index f574e00..bb27c94 100644 --- a/.gitea/workflows/deploy-demo.yaml +++ b/.gitea/workflows/deploy-demo.yaml @@ -74,7 +74,6 @@ jobs: echo "容器狀態:" && docker ps --filter "name=star-erp-laravel" - - name: Step 4 - Composer & NPM Build uses: appleboy/ssh-action@master with: diff --git a/compose.yaml b/compose.yaml index cf2aaea..eaa3ffb 100644 --- a/compose.yaml +++ b/compose.yaml @@ -8,11 +8,9 @@ services: image: 'sail-8.5/app' container_name: star-erp-laravel hostname: star-erp-laravel + network_mode: host extra_hosts: - 'host.docker.internal:host-gateway' - ports: - # - '${APP_PORT:-8080}:80' # 由 proxy 處理 - - '${VITE_PORT:-5173}:${VITE_PORT:-5173}' environment: WWWUSER: '${WWWUSER}' LARAVEL_SAIL: 1 @@ -21,18 +19,15 @@ services: IGNITION_LOCAL_SITES_PATH: '${PWD}' volumes: - '.:/var/www/html' - networks: - - sail depends_on: - mysql - redis - # - mailpit + mysql: image: 'mysql/mysql-server:8.0' container_name: star-erp-mysql hostname: star-erp-mysql - ports: - - '${FORWARD_DB_PORT:-3306}:3306' + network_mode: host environment: MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}' MYSQL_ROOT_HOST: '%' @@ -44,8 +39,6 @@ services: volumes: - 'sail-mysql:/var/lib/mysql' - './docker/mysql/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh' - networks: - - sail healthcheck: test: - CMD @@ -54,16 +47,14 @@ services: - '-p${DB_PASSWORD}' retries: 3 timeout: 5s + redis: image: 'redis:alpine' container_name: star-erp-redis hostname: star-erp-redis - # ports: - # - '${FORWARD_REDIS_PORT:-6379}:6379' + network_mode: host volumes: - 'sail-redis:/data' - networks: - - sail healthcheck: test: - CMD @@ -71,28 +62,16 @@ services: - ping retries: 3 timeout: 5s + proxy: image: 'nginx:alpine' container_name: star-erp-proxy - ports: - - '8080:8080' - - '8081:8081' + network_mode: host volumes: - './nginx/demo-proxy.conf:/etc/nginx/conf.d/default.conf:ro' - networks: - - sail depends_on: - laravel.test - # mailpit: - # image: 'axllent/mailpit:latest' - # ports: - # - '${FORWARD_MAILPIT_PORT:-1025}:1025' - # - '${FORWARD_MAILPIT_DASHBOARD_PORT:-8025}:8025' - # networks: - # - sail -networks: - sail: - driver: bridge + volumes: sail-mysql: driver: local