fix: prioritize local ./dist for frontend static files in Docker
This commit is contained in:
parent
57d470ed1d
commit
c2dd326855
1 changed files with 6 additions and 1 deletions
|
|
@ -60,7 +60,12 @@ func main() {
|
||||||
|
|
||||||
// Static Files (Frontend)
|
// Static Files (Frontend)
|
||||||
workDir, _ := os.Getwd()
|
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
|
// Check if frontend build exists
|
||||||
if _, err := os.Stat(frontendDir); os.IsNotExist(err) {
|
if _, err := os.Stat(frontendDir); os.IsNotExist(err) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue