diff --git a/Dockerfile b/Dockerfile index 7034332..3f3efca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,8 @@ RUN pip install -r requirements.txt COPY . . +VOLUME [ "/var/log" ] + EXPOSE 5000/tcp CMD ["python", "core/__main__.py"] \ No newline at end of file diff --git a/core/__main__.py b/core/__main__.py index 7d48780..af03ca1 100644 --- a/core/__main__.py +++ b/core/__main__.py @@ -5,6 +5,12 @@ app = Flask(__name__) +@app.route('/', methods=['GET']) +def index(): + logging.info('Request received from %s', request.remote_addr) + logging.info("Sending index page") + return jsonify({'message': 'To get your IP, send a GET request to /ip'}) + @app.route('/ip', methods=['GET']) def get_public_ip(): try: