From f2facd209bdc690a97fb2f30b964ec4404f870c9 Mon Sep 17 00:00:00 2001 From: Olivier Corradi Date: Sun, 7 Jan 2018 13:23:13 +0100 Subject: [PATCH] Fix mockserver --- docker-compose.yml | 2 +- mockserver/Dockerfile | 4 ++-- mockserver/server.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 42eccd5251..d59ef21b7e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.2' services: mockserver: build: mockserver - ports: ['9000:9000'] + ports: ['9000:8000'] volumes: - './mockserver/public:/home/public' - './mockserver/server.py:/home/server.py' diff --git a/mockserver/Dockerfile b/mockserver/Dockerfile index b28f5d3941..bc4b4b704d 100644 --- a/mockserver/Dockerfile +++ b/mockserver/Dockerfile @@ -1,5 +1,5 @@ FROM python:3.6 WORKDIR /home -EXPOSE 9000 +EXPOSE 8000 ADD server.py server.py -CMD cd public && python ../server.py 9000 +CMD cd public && python ../server.py diff --git a/mockserver/server.py b/mockserver/server.py index 575cbf3026..9b8a8faf95 100644 --- a/mockserver/server.py +++ b/mockserver/server.py @@ -2,7 +2,7 @@ # Usage: python __file__.py -from SimpleHTTPServer import SimpleHTTPRequestHandler, BaseHTTPServer +from http.server import SimpleHTTPRequestHandler, HTTPServer, test class CORSRequestHandler(SimpleHTTPRequestHandler): def do_OPTIONS(self): @@ -15,4 +15,4 @@ def end_headers(self): SimpleHTTPRequestHandler.end_headers(self) if __name__ == '__main__': - BaseHTTPServer.test(CORSRequestHandler, BaseHTTPServer.HTTPServer) + test(CORSRequestHandler, HTTPServer)