-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
27 lines (26 loc) · 1002 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM node:8 as frontend
RUN apt-get update && apt-get install -y bash git openssl curl sudo
WORKDIR /frontend
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
echo '%node ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
chown -R node:node . /frontend
USER node
COPY --chown=node:node ./frontend/package.json .
COPY --chown=node:node ./frontend/package-lock.json .
RUN npm install --production
COPY --chown=node:node ./frontend/ ./
RUN npm run build
FROM node:8
RUN apt-get update && apt-get install -y bash git openssl curl sudo
WORKDIR /backend
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
echo '%node ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
chown -R node:node . /backend
USER node
COPY --chown=node:node ./backend/package.json .
COPY --chown=node:node ./backend/package-lock.json .
RUN npm install --production
COPY --chown=node:node ./backend/ ./
COPY --from=frontend --chown=node:node /frontend /frontend
ENV DOCKER_BUILD=true
ENV NODE_ENV=production