build web UI in Dockerfile
this should make local dev/testing a bit more foolproof. this is done as
separate layers so that it doesn't run every time - only if the
dependencies or web/ change.
@@ -22,11 +22,20 @@ ENV CONCOURSE_TSA_WORKER_PRIVATE_KEY /concourse-keys/worker_key
RUN mkdir /src
WORKDIR /src
-# download and cache go modules in a docker layer
+# download go modules separately to enable caching
COPY go.mod .
COPY go.sum .
RUN go mod download
+# download yarn packages separately to enable caching
+COPY package.json .
+COPY yarn.lock .
+RUN yarn install
+
+# build web UI separately so we only build if necessary
+COPY web web
+RUN yarn build
+
# build Concourse
COPY . .
RUN go build -gcflags=all="-N -l" -o /usr/local/bin/concourse github.com/concourse/concourse/bin/cmd/concourse
