Fix cache headers for index html file (#28)
Part of <https://www.notion.so/Gentx-like-attestation-mechanism-to-add-validators-at-genesis-time-19da6b22d47280ecbf1fe657c241ff59> - Use serve package for controlling separate cache headers for files Reviewed-on: LaconicNetwork/laconic-wallet-web#28 Co-authored-by: Nabarun <nabarun@deepstacksoft.com> Co-committed-by: Nabarun <nabarun@deepstacksoft.com>
This commit is contained in:
parent
b2eafe59b3
commit
f47850ebfa
@ -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:
|
||||
|
@ -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
|
||||
|
22
stack/stack-orchestrator/config/app/serve.json
Normal file
22
stack/stack-orchestrator/config/app/serve.json
Normal file
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -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 . .
|
||||
|
Loading…
Reference in New Issue
Block a user