Skip to content

Commit

Permalink
Make web folder work with dev and Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
tma authored Apr 3, 2022
1 parent a5a5f00 commit e95015f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"type": "go",
"request": "launch",
"mode": "debug",
"program": "main.go"
"program": "cmd/main.go",
"cwd": "${workspaceFolder}"
}
]
}
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ RUN apk --no-cache add ca-certificates tzdata

WORKDIR /app

COPY --from=builder /go/bin/main /app/main
COPY --from=builder /go/src/app/web/templates /app/web/templates
COPY --from=builder /go/src/app/web/public /app/web/public
COPY --from=builder /go/bin/main /app/cmd/main
COPY --from=builder /go/src/app/web /app/web

ENTRYPOINT /app/main
ENTRYPOINT /app/cmd/main
EXPOSE 3000
2 changes: 1 addition & 1 deletion internal/app/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func WebStart(port string, car Car) {

router := mux.NewRouter()

fs := http.FileServer(http.Dir("public"))
fs := http.FileServer(http.Dir("web/public"))
publicHandler := http.StripPrefix("/public/", fs)

pathPrefix := os.Getenv("PATH_PREFIX")
Expand Down

0 comments on commit e95015f

Please sign in to comment.