From 84921cfd8365bb03a21cdfd0ee70517d61ce09e4 Mon Sep 17 00:00:00 2001 From: Andy Gayton Date: Wed, 6 Nov 2024 22:37:15 -0500 Subject: [PATCH] release: allow --expose to be enabled in the container image --- .github/workflows/Dockerfile.release-docker | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Dockerfile.release-docker b/.github/workflows/Dockerfile.release-docker index 1d1eccb..5fdd7a0 100644 --- a/.github/workflows/Dockerfile.release-docker +++ b/.github/workflows/Dockerfile.release-docker @@ -19,7 +19,5 @@ COPY target/release/xs /usr/local/bin/xs COPY target/release/scru128 /usr/bin/scru128 COPY xs.nu /app/xs.nu -EXPOSE 8080 - -CMD ["xs", "serve", "/app/store"] - +# Conditional CMD to append --expose based on XS_EXPOSE environment variable +ENTRYPOINT ["/bin/sh", "-c", 'if [ -n "$XS_EXPOSE" ]; then exec xs serve /app/store --expose "$XS_EXPOSE"; else exec xs serve /app/store; fi']