amper43
6 years ago
4 changed files with 49 additions and 0 deletions
@ -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"] |
@ -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…
Reference in new issue