Skip to content

Commit

Permalink
infra: add public variables to docker build steps (langfuse#2393)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdeichmann authored Jun 21, 2024
1 parent aebcac4 commit eea071c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docker-compose.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ services:
build:
dockerfile: ./web/Dockerfile
context: .
args:
- NEXT_PUBLIC_LANGFUSE_CLOUD_REGION=${NEXT_PUBLIC_LANGFUSE_CLOUD_REGION}
depends_on:
- db
- redis
Expand All @@ -30,6 +32,8 @@ services:
build:
dockerfile: ./worker/Dockerfile
context: .
args:
- NEXT_PUBLIC_LANGFUSE_CLOUD_REGION=${NEXT_PUBLIC_LANGFUSE_CLOUD_REGION}
depends_on:
- db
- redis
Expand Down
8 changes: 8 additions & 0 deletions web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ RUN pnpm install --frozen-lockfile

ENV DOCKER_BUILD 1

# pass public variables in build step
ARG NEXT_PUBLIC_LANGFUSE_CLOUD_REGION
ARG NEXT_PUBLIC_DEMO_PROJECT_ID
ARG NEXT_PUBLIC_SIGN_UP_DISABLED
ARG NEXT_PUBLIC_TURNSTILE_SITE_KEY
ARG NEXT_PUBLIC_POSTHOG_KEY
ARG NEXT_PUBLIC_POSTHOG_HOST
ARG NEXT_PUBLIC_CRISP_WEBSITE_ID

# Copy source code of isolated subworkspace
COPY --from=pruner /app/out/full/ .
Expand Down
5 changes: 5 additions & 0 deletions worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ COPY --from=pruner /app/out/json/ .

RUN pnpm install --frozen-lockfile

# pass public variables in build step
ARG NEXT_PUBLIC_LANGFUSE_CLOUD_REGION
ARG NEXT_PUBLIC_DEMO_PROJECT_ID
ARG NEXT_PUBLIC_POSTHOG_KEY
ARG NEXT_PUBLIC_POSTHOG_HOST

# Copy source code of isolated subworkspace
COPY --from=pruner /app/out/full/ .
Expand Down

0 comments on commit eea071c

Please sign in to comment.