Skip to content

Commit

Permalink
Support public path feature in Docker image (#213)
Browse files Browse the repository at this point in the history
* Support serving UI from sub path

* handle public path with URL rewrite

* Support changing public path when running from Docker image
  • Loading branch information
feedmeapples authored Sep 9, 2022
1 parent 157ba50 commit 1a32cf6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
ARG BASE_SERVER_IMAGE=temporalio/base-server:1.9.0
ARG BASE_BUILDER_IMAGE=temporalio/base-builder:1.8.0
ARG GOPROXY

##### UI builder #####
FROM ${BASE_BUILDER_IMAGE} AS ui-builder
ARG TEMPORAL_PUBLIC_PATH

WORKDIR /home/ui-builder

# pre-build dependecies to improve subsequent build times
RUN apk add --update --no-cache \
npm
RUN npm install -g pnpm

COPY go.mod go.sum ./
RUN go mod download

COPY . .
RUN make build-server
ENV VITE_PUBLIC_PATH=$TEMPORAL_PUBLIC_PATH
RUN make install build-ui build-server

##### UI server #####
FROM ${BASE_SERVER_IMAGE} AS ui-server
Expand Down
6 changes: 3 additions & 3 deletions cloud.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
ARG BASE_SERVER_IMAGE=temporalio/base-server:1.9.0
ARG BASE_BUILDER_IMAGE=temporalio/base-builder:1.8.0
ARG GOPROXY

##### UI builder #####
FROM ${BASE_BUILDER_IMAGE} AS ui-builder
ARG TEMPORAL_PUBLIC_PATH

WORKDIR /home/ui-builder

RUN apk add --update --no-cache \
npm

RUN npm install -g pnpm

COPY go.mod go.sum ./
RUN go mod download

COPY . .
RUN make install-utils install-ui build-cloud
ENV VITE_PUBLIC_PATH=$TEMPORAL_PUBLIC_PATH
RUN make install build-cloud

##### UI server #####
FROM ${BASE_SERVER_IMAGE} AS ui-server
Expand Down

0 comments on commit 1a32cf6

Please sign in to comment.