diff --git a/server/Dockerfile b/server/Dockerfile index e69de29..0ac62dd 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -0,0 +1,17 @@ +FROM alpine + +RUN apk add --no-cache py3-pip + +WORKDIR /app + +RUN python3 -m pip install --no-cache-dir --break-system-packages waitress + +COPY req.txt . +RUN python3 -m pip install --no-cache-dir --break-system-packages -r req.txt + +COPY ./ . + +EXPOSE 5000/tcp + +ENTRYPOINT ["waitress-serve"] +CMD ["--host", "0.0.0.0", "--port", "5000", "--call", "app:createApp"] \ No newline at end of file diff --git a/server/app.py b/server/app.py new file mode 100644 index 0000000..93c4d0f --- /dev/null +++ b/server/app.py @@ -0,0 +1,5 @@ +import main as server +def createApp(envivorment=None, start_response=None): + with server.app.app_context(): + server.create_app() + return server.app \ No newline at end of file diff --git a/server/main.py b/server/main.py index 3e9980e..318bf26 100644 --- a/server/main.py +++ b/server/main.py @@ -62,5 +62,8 @@ def get_path(): # If the path is neither a file nor a directory, return an error return jsonify({"error": "Invalid path type."}), 400 +def create_app(): + pass + if __name__ == '__main__': app.run(debug=True) diff --git a/server/req.txt b/server/req.txt new file mode 100644 index 0000000..8ab6294 --- /dev/null +++ b/server/req.txt @@ -0,0 +1 @@ +flask \ No newline at end of file