Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit 3b234ed

Browse files
committed
Fix release download
1 parent 348e36a commit 3b234ed

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,21 @@ COPY . /app
2424
# Build the webapp
2525
FROM node:23-slim AS webbuilder
2626

27+
# Set the release URL (this should be static and not change often)
28+
ARG LATEST_RELEASE=https://api.github.com/repos/stacklok/codegate-ui/releases/latest
29+
2730
# Install curl for downloading the webapp from GH and unzip to extract it
2831
RUN apt-get update && apt-get install -y --no-install-recommends \
2932
curl \
33+
jq \
3034
unzip\
3135
ca-certificates
3236

3337
WORKDIR /usr/src/
3438

35-
# To ensure we always download the latest release of the webapp, we use a build argument.
36-
# This prevents the curl command from being cached by Docker.
37-
38-
ARG LATEST_RELEASE=LATEST
39-
RUN echo "Latest FE release: $LATEST_RELEASE"
40-
RUN LATEST_RELEASE=${LATEST_RELEASE} curl -L -o main.zip ${LATEST_RELEASE}
39+
# Download the latest release of the webapp
40+
RUN echo "Latest FE release: $(curl -s ${LATEST_RELEASE} | jq -r '.tag_name')"
41+
RUN curl -s ${LATEST_RELEASE} | jq -r '.zipball_url' | xargs curl -L -o main.zip
4142

4243
# Extract the downloaded zip file
4344
RUN unzip main.zip
@@ -111,4 +112,4 @@ USER codegate
111112

112113
# Set the container's default entrypoint
113114
EXPOSE 8989
114-
ENTRYPOINT ["/app/scripts/entrypoint.sh"]
115+
ENTRYPOINT ["/app/scripts/entrypoint.sh"]

0 commit comments

Comments
 (0)