Skip to content

Commit cf2be83

Browse files
committed
Set secret on GCP directly with an env variable
1 parent 0d1b0dc commit cf2be83

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ ENV ENV=production
3232
ENV MPLCONFIGDIR=/tmp/matplotlib
3333
EXPOSE 8080
3434

35-
ARG PANEL_TOKEN
36-
ENV PANEL_BASIC_AUTH=$PANEL_TOKEN
37-
3835
COPY --from=builder /usr/local/lib/python3.11/site-packages/ /usr/local/lib/python3.11/site-packages/
3936
COPY --from=builder /usr/local/bin/panel /usr/local/bin/panel
4037
COPY --from=builder /app /app

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ serve-dev: ## Serve Panel dashboard - Dev mode
4242
panel serve panel/app.py --show --autoreload
4343

4444
serve: ## Serve Panel dashboard - Prod mode
45-
panel serve panel/app.py --basic-auth $(PANEL_TOKEN) --cookie-secret panel_cookie_secret --basic-login-template panel/login.html --logout-template panel/logout.html --static-dirs _static=docs/_static
45+
PANEL_BASIC_AUTH=$(PANEL_TOKEN) panel serve panel/app.py \
46+
--cookie-secret panel_cookie_secret \
47+
--basic-login-template panel/login.html \
48+
--logout-template panel/logout.html \
49+
--static-dirs _static=docs/_static
4650

4751
build-local:
4852
docker build -f ./Dockerfile \
@@ -89,6 +93,7 @@ production: publish-production
8993
--region=$(region) \
9094
--port=8080 \
9195
--set-env-vars ENV=production \
96+
--set-secrets=PANEL_BASIC_AUTH=PANEL_TOKEN:latest \
9297
--allow-unauthenticated \
9398
--timeout=600 \
9499
--service-account simdec-panel@delta-entity-401706.iam.gserviceaccount.com \

0 commit comments

Comments
 (0)