mirror of
https://github.com/FAUSheppy/homelab_gamevault
synced 2025-12-05 22:51:34 +01:00
feat: docker build for http server
This commit is contained in:
@@ -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"]
|
||||||
5
server/app.py
Normal file
5
server/app.py
Normal file
@@ -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
|
||||||
@@ -62,5 +62,8 @@ def get_path():
|
|||||||
# If the path is neither a file nor a directory, return an error
|
# If the path is neither a file nor a directory, return an error
|
||||||
return jsonify({"error": "Invalid path type."}), 400
|
return jsonify({"error": "Invalid path type."}), 400
|
||||||
|
|
||||||
|
def create_app():
|
||||||
|
pass
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(debug=True)
|
app.run(debug=True)
|
||||||
|
|||||||
1
server/req.txt
Normal file
1
server/req.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
flask
|
||||||
Reference in New Issue
Block a user