From 94aa2349b85021acfc3c42280e4fb1757b3c4cce Mon Sep 17 00:00:00 2001 From: amper43 Date: Fri, 5 Oct 2018 04:44:01 +0300 Subject: [PATCH] add new dockerfiles --- analytics/.dockerignore | 3 +++ analytics/Dockerfile | 18 ++++++++++++++++++ server/.dockerignore | 3 +++ server/Dockerfile | 25 +++++++++++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 analytics/.dockerignore create mode 100644 analytics/Dockerfile create mode 100644 server/.dockerignore create mode 100644 server/Dockerfile diff --git a/analytics/.dockerignore b/analytics/.dockerignore new file mode 100644 index 0000000..4a0e90e --- /dev/null +++ b/analytics/.dockerignore @@ -0,0 +1,3 @@ +.git +node_modules +npm-debug diff --git a/analytics/Dockerfile b/analytics/Dockerfile new file mode 100644 index 0000000..79a71ec --- /dev/null +++ b/analytics/Dockerfile @@ -0,0 +1,18 @@ +FROM python:3.6.6 + +VOLUME [ "/var/www/data" ] + +COPY analytics/ /var/www/analytics/ + +WORKDIR /var/www/analytics + +RUN pip install -r requirements.txt \ + && apt-get update && apt-get install -y \ + apt-utils \ + gnupg \ + curl \ + make \ + g++ \ + git + +CMD ["python", "server.py"] diff --git a/server/.dockerignore b/server/.dockerignore new file mode 100644 index 0000000..4a0e90e --- /dev/null +++ b/server/.dockerignore @@ -0,0 +1,3 @@ +.git +node_modules +npm-debug diff --git a/server/Dockerfile b/server/Dockerfile new file mode 100644 index 0000000..d7702ae --- /dev/null +++ b/server/Dockerfile @@ -0,0 +1,25 @@ +#base image +FROM node:carbon AS base + +#dependencies +FROM base AS dependencies +WORKDIR /var/www/server +COPY package*.json ./ +RUN npm install + +#build +FROM dependencies AS build +COPY . /var/www/server +WORKDIR /var/www/server +RUN npm run build + +#release +FROM node:8.9-alpine AS release +WORKDIR /var/www/server +COPY --from=dependencies /var/www/server/package.json ./ +RUN npm install +COPY --from=build /var/www/server ./ + +ENV INSIDE_DOCKER true +VOLUME [ "/var/www/data" ] +CMD ["npm", "start"]