Browse Source

add new dockerfiles

pull/1/head
amper43 6 years ago
parent
commit
94aa2349b8
  1. 3
      analytics/.dockerignore
  2. 18
      analytics/Dockerfile
  3. 3
      server/.dockerignore
  4. 25
      server/Dockerfile

3
analytics/.dockerignore

@ -0,0 +1,3 @@
.git
node_modules
npm-debug

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

3
server/.dockerignore

@ -0,0 +1,3 @@
.git
node_modules
npm-debug

25
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"]
Loading…
Cancel
Save