Use serve for removing index.html caching
This commit is contained in:
parent
b2eafe59b3
commit
8c7561050c
@ -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,8 @@ mkdir -p "$(dirname "$FILE_PATH")"
|
||||
# Write verification code to the file
|
||||
echo "$WALLET_CONNECT_VERIFY_CODE" > "$FILE_PATH"
|
||||
|
||||
# Copy over serve config to build
|
||||
cp /app/serve/serve.json /app/build/serve.json
|
||||
|
||||
# Serve build dir
|
||||
http-server --proxy http://localhost:80? -p 80 /app/build
|
||||
serve -s -l 80 /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/(.*)",
|
||||
"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