memex-in commited on
Commit
c95fd4d
·
verified ·
1 Parent(s): 234d28d

Update run.sh

Browse files
Files changed (1) hide show
  1. run.sh +3 -25
run.sh CHANGED
@@ -1,28 +1,6 @@
1
  #!/bin/bash
2
 
3
- # This script starts a Python HTTP server with custom headers
4
- # required for SharedArrayBuffer (COEP and COOP).
5
 
6
- # Create a temporary Python server script
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