Spaces:
Sleeping
Sleeping
Commit
·
d564cda
1
Parent(s):
5184575
Move to port 7860
Browse files- Dockerfile +2 -2
- server.py +1 -1
Dockerfile
CHANGED
|
@@ -8,8 +8,8 @@ WORKDIR /app
|
|
| 8 |
COPY server.py .
|
| 9 |
COPY index.html .
|
| 10 |
|
| 11 |
-
# Expose port
|
| 12 |
-
EXPOSE
|
| 13 |
|
| 14 |
# Start the Python HTTP server when the container launches
|
| 15 |
CMD ["python", "server.py"]
|
|
|
|
| 8 |
COPY server.py .
|
| 9 |
COPY index.html .
|
| 10 |
|
| 11 |
+
# Expose port 7860 to allow external access
|
| 12 |
+
EXPOSE 7860
|
| 13 |
|
| 14 |
# Start the Python HTTP server when the container launches
|
| 15 |
CMD ["python", "server.py"]
|
server.py
CHANGED
|
@@ -4,7 +4,7 @@ class MyHandler(SimpleHTTPRequestHandler):
|
|
| 4 |
def __init__(self, *args, **kwargs):
|
| 5 |
super().__init__(*args, directory='.', **kwargs)
|
| 6 |
|
| 7 |
-
def run(server_class=HTTPServer, handler_class=MyHandler, port=
|
| 8 |
server_address = ('', port)
|
| 9 |
httpd = server_class(server_address, handler_class)
|
| 10 |
print(f'Starting httpd server on port {port}...')
|
|
|
|
| 4 |
def __init__(self, *args, **kwargs):
|
| 5 |
super().__init__(*args, directory='.', **kwargs)
|
| 6 |
|
| 7 |
+
def run(server_class=HTTPServer, handler_class=MyHandler, port=7860):
|
| 8 |
server_address = ('', port)
|
| 9 |
httpd = server_class(server_address, handler_class)
|
| 10 |
print(f'Starting httpd server on port {port}...')
|