fix: prioritize local ./dist for frontend static files in Docker

This commit is contained in:
vndangkhoa 2026-02-01 19:46:57 +07:00
parent 57d470ed1d
commit c2dd326855

View file

@ -60,7 +60,12 @@ func main() {
// Static Files (Frontend)
workDir, _ := os.Getwd()
frontendDir := filepath.Join(workDir, "..", "frontend-react", "dist")
frontendDir := filepath.Join(workDir, "dist") // Production (Docker)
// Check if frontend build exists in local dist, otherwise try dev path
if _, err := os.Stat(frontendDir); os.IsNotExist(err) {
frontendDir = filepath.Join(workDir, "..", "frontend-react", "dist") // Development
}
// Check if frontend build exists
if _, err := os.Stat(frontendDir); os.IsNotExist(err) {