Files
finance_app/docker-compose.yml
henry yo 5241d2c9c6
All checks were successful
Laravel-Oracle-Deploy / redeploy (push) Successful in 14s
config: change docker-compose.yml
2026-06-30 23:28:52 +08:00

48 lines
1.4 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
services:
# 🐘 1. 你的 Laravel 後端服務
finance-backend:
build:
context: .
dockerfile: Dockerfile
container_name: finance-laravel-backend
restart: always
ports:
- "8081:9000"
environment:
- APP_ENV=production
- APP_DEBUG=false
- DB_CONNECTION=pgsql
- DB_HOST=1Panel-postgresql-PXlc # 🎯 關鍵:改用資料庫的服務名稱當作 Host
- DB_PORT=5432
- DB_DATABASE=myfinance
- DB_USERNAME=myfinance_henry4682
- DB_PASSWORD=DwmQ78PB
networks:
- 1panel-network
depends_on:
- finance-postgres # 🎯 確保資料庫先開,後端才開
# 🐬 2. 直接在這裡把消失的 PostgreSQL 生回來!
# finance-postgres:
# image: postgres:15-alpine # 使用穩定的 15-alpine 版本
# container_name: finance-laravel-backend-postgres
# restart: always
# ports:
# - "5433:5432" # 🎯 把 5432 暴露給實體主機,這樣你本機的 pgAdmin 就能連進來了!
# environment:
# - POSTGRES_DB=myfinance
# - POSTGRES_USER=myfinance_henry4682
# - POSTGRES_PASSWORD=DwmQ78PB
# volumes:
# - finance_db_data:/var/lib/postgresql/data # 🎯 資料持久化,容器重啟資料也不會掉
# networks:
# - 1panel-network
networks:
1panel-network:
external: true
# 🎯 定義資料庫的儲存卷
volumes:
finance_db_data: