Commit 398eb6ba authored by Florent Chehab's avatar Florent Chehab

fix(documentation): try to reduce browser caching in dev

parent 83d3e5a6
......@@ -108,7 +108,7 @@ services:
build: ./documentation
volumes: ["./documentation:/usr/src/app"]
# Start a simple python folder
command: /bin/sh -c "python -m http.server 5000"
command: python run_server.py
ports: ["5000:5000"] # replicate the server port
# service to generate the UML of the backend
......
# Very basic Dockerfile that simply pull a python image to run a pyton server.
# Pull official base image
FROM python:3.7.2-alpine3.9
FROM python:3.8-alpine
# Set-up a workdir so that it can be mapped to a volume in docker-compose.
WORKDIR /usr/src/app
#!/usr/bin/env python
import http.server
class MyHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
def end_headers(self):
# Prevent annoying caching of the documentation
self.send_header("Cache-Control", "no-cache, no-store, must-revalidate")
self.send_header("Pragma", "no-cache")
self.send_header("Expires", "0")
http.server.SimpleHTTPRequestHandler.end_headers(self)
if __name__ == "__main__":
httpd = http.server.HTTPServer(("0.0.0.0", 5000), MyHTTPRequestHandler)
httpd.serve_forever()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment