Update run.sh
Browse files
run.sh
CHANGED
@@ -1,28 +1,6 @@
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
-
# This script
|
4 |
-
#
|
5 |
|
6 |
-
|
7 |
-
cat <<EOF > server.py
|
8 |
-
import http.server
|
9 |
-
import socketserver
|
10 |
-
|
11 |
-
PORT = 8000
|
12 |
-
|
13 |
-
class Handler(http.server.SimpleHTTPRequestHandler):
|
14 |
-
def end_headers(self):
|
15 |
-
# Add the required Cross-Origin-Embedder-Policy header
|
16 |
-
self.send_header('Cross-Origin-Embedder-Policy', 'require-corp')
|
17 |
-
# Add the required Cross-Origin-Opener-Policy header
|
18 |
-
self.send_header('Cross-Origin-Opener-Policy', 'same-origin')
|
19 |
-
super().end_headers() # Call the original end_headers to send other headers
|
20 |
-
|
21 |
-
# Start the server
|
22 |
-
with socketserver.TCPServer(("", PORT), Handler) as httpd:
|
23 |
-
print(f"Serving real_webvm.html at http://localhost:{PORT}")
|
24 |
-
httpd.serve_forever()
|
25 |
-
EOF
|
26 |
-
|
27 |
-
# Execute the Python server script
|
28 |
-
python server.py
|
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
+
# This script simply executes the Python HTTP server.
|
4 |
+
# The server.py file is now created directly by the Dockerfile.
|
5 |
|
6 |
+
python /app/server.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|