gr701_kinvya 2 年之前
父節點
當前提交
d950e9b0b6
共有 3 個文件被更改,包括 10 次插入1 次删除
  1. 1 1
      Code.py
  2. 7 0
      Dockerfile
  3. 2 0
      requirements.txt

+ 1 - 1
Code.py

@@ -53,7 +53,7 @@ class HttpGetHandler(BaseHTTPRequestHandler):
             self.send_error(400,f"File not found{self.path}")
 
 def main(server_class=HTTPServer,handler_class=HttpGetHandler):
-    server_address = ('localhost',8000)
+    server_address = ('',8000)
     httpd = server_class(server_address,handler_class)
     try: 
         print("Starting the Server!")

+ 7 - 0
Dockerfile

@@ -0,0 +1,7 @@
+FROM python:3.8-slim-buster
+WORKDIR /site
+COPY requirements.txt requirements.txt
+RUN pip3 install -r requirements.txt
+COPY . .
+CMD ["python3","./Code.py"]
+EXPOSE 8000

+ 2 - 0
requirements.txt

@@ -0,0 +1,2 @@
+datetime
+