From 9825a1f18f7379885115afa2eb67ff1bc35f1bf7 Mon Sep 17 00:00:00 2001 From: rozetko Date: Sat, 28 Jul 2018 12:47:05 +0300 Subject: [PATCH] WIP: Docker file after 0.12 alpha release #35 (#99) * Make Dockerfile use requirements.txt * anomalies directory -> analytic_units * /tmp volume * Update docs * Remove /tmp volume * Volumes in multiple lines --- Dockerfile | 21 +++++++++++++-------- README.md | 8 +++++++- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 663600a..41e9e11 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,16 +2,19 @@ FROM python:3 EXPOSE 8000 -VOLUME [ "/var/www/data/anomalies", "/var/www/data/datasets", "/var/www/data/metrics", "/var/www/data/models", "/var/www/data/segments" ] - -RUN pip install pandas -RUN pip install seglearn -RUN pip install scipy -RUN pip install tsfresh +VOLUME [ \ + "/var/www/data/analytic_units", \ + "/var/www/data/datasets", \ + "/var/www/data/metrics", \ + "/var/www/data/models", \ + "/var/www/data/segments" \ +] COPY . /var/www -WORKDIR /var/www/server +WORKDIR /var/www/analytics + +RUN pip install -r requirements.txt RUN apt-get update && apt-get install -y \ apt-utils \ @@ -21,10 +24,12 @@ RUN apt-get update && apt-get install -y \ make \ g++ \ git -RUN curl -sL https://deb.nodesource.com/setup_9.x | bash - +RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - RUN apt-get update && apt-get install -y nodejs +WORKDIR /var/www/server + RUN npm install && npm run build CMD ["npm", "start"] diff --git a/README.md b/README.md index 62dada4..7acf9b1 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,13 @@ docker build -t hastic-server . #### Run ```bash -docker run -d --name hastic-server -p 80:8000 -e HASTIC_API_KEY= hastic-server +docker run -d \ + --name hastic-server \ + --ipc host \ + -p 80:8000 \ + -e HASTIC_API_KEY= \ + -v /tmp:/tmp \ + hastic-server ``` ### Changelog