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"]