diff --git a/stack/stack-orchestrator/compose/docker-compose-laconic-wallet-web.yml b/stack/stack-orchestrator/compose/docker-compose-laconic-wallet-web.yml index 79bd086..0b62679 100644 --- a/stack/stack-orchestrator/compose/docker-compose-laconic-wallet-web.yml +++ b/stack/stack-orchestrator/compose/docker-compose-laconic-wallet-web.yml @@ -14,6 +14,7 @@ services: command: ["bash", "/scripts/run.sh"] volumes: - ../config/app/run.sh:/scripts/run.sh + - ../config/app/serve.json:/app/serve.json ports: - "80" healthcheck: diff --git a/stack/stack-orchestrator/config/app/run.sh b/stack/stack-orchestrator/config/app/run.sh index 72d0e17..084f89b 100755 --- a/stack/stack-orchestrator/config/app/run.sh +++ b/stack/stack-orchestrator/config/app/run.sh @@ -28,5 +28,5 @@ mkdir -p "$(dirname "$FILE_PATH")" # Write verification code to the file echo "$WALLET_CONNECT_VERIFY_CODE" > "$FILE_PATH" -# Serve build dir -http-server --proxy http://localhost:80? -p 80 /app/build +# Serve build dir with explicit config +serve -s -l 80 -c /app/serve.json /app/build diff --git a/stack/stack-orchestrator/config/app/serve.json b/stack/stack-orchestrator/config/app/serve.json new file mode 100644 index 0000000..2e60248 --- /dev/null +++ b/stack/stack-orchestrator/config/app/serve.json @@ -0,0 +1,22 @@ +{ + "headers": [ + { + "source": "/index.html", + "headers": [ + { + "key": "Cache-Control", + "value": "no-cache, must-revalidate" + } + ] + }, + { + "source": "/static/**/*.{js,css,png,jpg,jpeg,gif,svg,ico}", + "headers": [ + { + "key": "Cache-Control", + "value": "public, max-age=31536000, immutable" + } + ] + } + ] +} diff --git a/stack/stack-orchestrator/container-build/cerc-laconic-wallet-web/Dockerfile b/stack/stack-orchestrator/container-build/cerc-laconic-wallet-web/Dockerfile index e00ac66..f186f45 100644 --- a/stack/stack-orchestrator/container-build/cerc-laconic-wallet-web/Dockerfile +++ b/stack/stack-orchestrator/container-build/cerc-laconic-wallet-web/Dockerfile @@ -33,7 +33,7 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ RUN mkdir -p /scripts # Install simple web server for now (use nginx perhaps later) -RUN yarn global add http-server +RUN yarn global add serve WORKDIR /app COPY . .