From 257687abb2cf1c8240cafbd43f6cdbfec6bc62e2 Mon Sep 17 00:00:00 2001 From: Mathieu B Date: Wed, 30 Nov 2022 14:00:43 +0100 Subject: [PATCH] docker stuff --- Dockerfile | 6 +++--- Dockerfile.alpine | 25 +++++++++++++++++++++++ jarvis/__init__.py | 0 api.py => jarvis/api.py | 0 start.py => jarvis/start.py | 0 test_whisper.py => jarvis/test_whisper.py | 0 6 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 Dockerfile.alpine create mode 100644 jarvis/__init__.py rename api.py => jarvis/api.py (100%) rename start.py => jarvis/start.py (100%) rename test_whisper.py => jarvis/test_whisper.py (100%) diff --git a/Dockerfile b/Dockerfile index 61a035b..734146b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:21.04 +FROM debian:bullseye ENV DEBIAN_FRONTEND=noninteractive ENV ENV_STATUS=${NODE_ENV:-production} @@ -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 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 git clone --progress --verbose https://github.com/M4TH1EU/jarvis-server-v2.git . RUN python3 -m pip install -r requirements.txt @@ -18,4 +18,4 @@ RUN apt-get clean -y EXPOSE 5000 -CMD [ "python3", "start.py"] \ No newline at end of file +ENTRYPOINT [ "python3", "/jarvis/start.py"] \ No newline at end of file diff --git a/Dockerfile.alpine b/Dockerfile.alpine new file mode 100644 index 0000000..2052526 --- /dev/null +++ b/Dockerfile.alpine @@ -0,0 +1,25 @@ +# ALPINE VERSION OF THE DOCKER FILE, NOT WORKING ATM. +# TRYING TO SEE IF THERE IS A DIFFERENCE USING AN UBUNTU IMAGE OR AN ALPINE + +FROM python:3.9-alpine + +ENV ENV_STATUS=${NODE_ENV:-production} + +# For suport set local time zone. +RUN apk update && apk upgrade + +RUN apk add --no-cache --upgrade grep + +WORKDIR /jarvis + +COPY ./jarvis /jarvis + +# RUN apk add build-base python3 python3-dev py3-pip py3-distutils-extra py3-fann2 fann-dev swig + +RUN python3 -m pip install --no-cache-dir -r requirements.txt + +RUN apk cache clean + +EXPOSE 5000 + +ENTRYPOINT [ "python3", "/jarvis/start.py"] \ No newline at end of file diff --git a/jarvis/__init__.py b/jarvis/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/api.py b/jarvis/api.py similarity index 100% rename from api.py rename to jarvis/api.py diff --git a/start.py b/jarvis/start.py similarity index 100% rename from start.py rename to jarvis/start.py diff --git a/test_whisper.py b/jarvis/test_whisper.py similarity index 100% rename from test_whisper.py rename to jarvis/test_whisper.py