FrontendService: Fix backend.dockerfile (#108195)

* FrontendService: Fix backend.dockerfile

* comments

* Fix backends rebuilding image instead of just restarting when assets change

* route /logout to grafana backend

* fix script in dockerfile
pull/107817/head
Josh Hunt 2 days ago committed by GitHub
parent 8dfb4cdfc9
commit 4e9c670a00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      Dockerfile
  2. 2
      devenv/frontend-service/Tiltfile
  3. 4
      devenv/frontend-service/backend.dockerfile
  4. 2
      devenv/frontend-service/nginx.conf

@ -69,7 +69,8 @@ COPY go.* ./
COPY .bingo .bingo
COPY .citools .citools
# Include vendored dependencies
# Copy go dependencies first
# If updating this, please also update devenv/frontend-service/backend.dockerfile
COPY pkg/util/xorm pkg/util/xorm
COPY pkg/apiserver pkg/apiserver
COPY pkg/apimachinery pkg/apimachinery

@ -62,7 +62,7 @@ docker_build('grafana-backend', '../..',
"./public/build/assets-manifest.json",
],
live_update = [
sync('./public/build/assets-manifest.json', '/grafana/public/build/assets-manifest.json'),
sync('../../public/build/assets-manifest.json', '/grafana/public/build/assets-manifest.json'),
restart_container()
]
)

@ -20,7 +20,8 @@ RUN go env GOPATH
COPY Makefile devenv/frontend-service/build-grafana.sh ./
# Copy go mod files first
# $: ls -1 {pkg,scripts,apps}**/go.{mod,sum} | sed 's#\(.*\)/go\.\(mod\|sum\)#COPY \1/go.* \1/#' | sort -u
# run this command and replace the output below:
# find pkg scripts apps -type f \( -name go.mod -o -name go.sum \) -print | sed -E 's#(.*)/go\.(mod|sum)$#COPY \1/go.* \1/#' | sort -u
COPY apps/advisor/go.* apps/advisor/
COPY apps/alerting/notifications/go.* apps/alerting/notifications/
COPY apps/dashboard/go.* apps/dashboard/
@ -31,7 +32,6 @@ COPY apps/playlist/go.* apps/playlist/
COPY apps/secret/go.* apps/secret/
COPY pkg/aggregator/go.* pkg/aggregator/
COPY pkg/apimachinery/go.* pkg/apimachinery/
COPY pkg/apis/secret/go.* pkg/apis/secret/
COPY pkg/apiserver/go.* pkg/apiserver/
COPY pkg/build/go.* pkg/build/
COPY pkg/build/wire/go.* pkg/build/wire/

@ -36,7 +36,7 @@ server {
# API calls go to the backend
# Cheat with app plugin paths and route them to the backend. These should come from
# the Plugin CDN
location ~ ^/(api|apis|bootdata|public\/plugins\/grafana\-\w+\-app) {
location ~ ^/(api|apis|bootdata|logout|public\/plugins\/grafana\-\w+\-app) {
proxy_pass http://backend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;

Loading…
Cancel
Save