diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8b7f84b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM python:3 + +EXPOSE 8000 + +VOLUME [ "/var/www/src/anomalies", "/var/www/src/datasets", "/var/www/src/metrics", "/var/www/src/models", "/var/www/src/segments" ] + +RUN pip install pandas +RUN pip install seglearn +RUN pip install scipy +RUN pip install fbprophet + +COPY . /var/www + +WORKDIR /var/www/server + +RUN apt-get update && apt-get install -y \ + apt-utils \ + gnupg \ + curl \ + python \ + make \ + g++ \ + git +RUN curl -sL https://deb.nodesource.com/setup_9.x | bash - + +RUN apt-get update && apt-get install -y nodejs + +RUN npm install && npm run build + +CMD ["npm", "start"] diff --git a/README.md b/README.md index 0fb5bae..5a03b5a 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,17 @@ # Hastic server -Implementation of basic pattern recognition and unsupervised learning for anomamaly detection. +Implementation of basic pattern recognition and unsupervised learning for anomaly detection. Implementation of analytic unit for Hastic. see [REST API](REST.md) ## Build & run -### Analytic unit +### Docker -Python3 project +Example running hastic-server in Docker: ``` -pip3 install pandas -pip3 install influxdb - -``` - -### Server - -Node.js project - -``` -cd server -npm install -npm run build -npm start +docker build -t hastic-server . +docker run -d --name hastic-server -p 80:8000 -e API_KEY= hastic-server ```