docker stuff

This commit is contained in:
Mathieu B 2022-11-29 21:40:20 +01:00
parent 94e03b95ec
commit 0e0c34fa04
4 changed files with 8 additions and 10 deletions

View File

@ -10,7 +10,7 @@ WORKDIR /jarvis
RUN apt install python3.9 python3-pip python3.9-dev python3.9-distutils python3-fann2 libfann-dev swig git python3-levenshtein curl -y RUN apt install python3.9 python3-pip python3.9-dev python3.9-distutils python3-fann2 libfann-dev swig git python3-levenshtein curl -y
RUN git clone --branch $(curl --silent "https://api.github.com/repos/m4th1eu/jarvis-server/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")') --progress --verbose https://github.com/M4TH1EU/jarvis-server.git . RUN git clone --branch $(curl --silent "https://api.github.com/repos/m4th1eu/jarvis-server-v2/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")') --progress --verbose https://github.com/M4TH1EU/jarvis-server-v2.git .
RUN python3 -m pip install -r requirements.txt RUN python3 -m pip install -r requirements.txt
@ -18,8 +18,4 @@ RUN apt-get clean -y
EXPOSE 5000 EXPOSE 5000
COPY start.sh /jarvis/ CMD [ "python3", "start.py"]
RUN chmod +x start.sh
CMD "./start.sh"

4
api.py
View File

@ -64,7 +64,3 @@ def start_server():
app.config['JSON_AS_ASCII'] = False app.config['JSON_AS_ASCII'] = False
# TODO: add to config # TODO: add to config
app.run(port=5000, debug=False, host='0.0.0.0', threaded=True) app.run(port=5000, debug=False, host='0.0.0.0', threaded=True)
if __name__ == '__main__':
start_server()

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
requests~=2.28.1
Flask~=2.2.2

4
start.py Normal file
View File

@ -0,0 +1,4 @@
import api
if __name__ == '__main__':
api.start_server()