Skip to content

Commit

Permalink
use clean images in last step (#498)
Browse files Browse the repository at this point in the history
* use clean images in last step

* Update Dockerfile
  • Loading branch information
Yshayy committed Jul 20, 2017
1 parent e852bfe commit 8f6288f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 7 additions & 3 deletions services/editor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# ---- Base ----
FROM soluto/nodegit-alpine:8.1.4 AS base

# ---- Deps ----
FROM base AS deps
COPY package.json yarn.lock /src/
RUN ln -s /nodegit/node_modules /src/node_modules
WORKDIR /src/
RUN yarn --prod

# ---- Build ----
FROM base AS build
FROM deps AS build

RUN yarn

Expand All @@ -20,15 +22,17 @@ FROM base AS release

COPY --from=build /src/dist/ /opt/app/dist
COPY --from=build /src/build/ /opt/app/dist/build
RUN ln -s /src/node_modules /opt/app/node_modules
COPY --from=deps /src/node_modules /opt/app/node_modules
COPY ./build-index/ /opt/app/build-index

WORKDIR /opt/app/
VOLUME /opt/vapid/

RUN yarn cache clean

ENV NODE_ENV=production
ENV PORT=3000
ENV VAPID_KEYS=/opt/vapid/keys.json
EXPOSE 3000

ENTRYPOINT [ "node", "./dist/index.js" ]
ENTRYPOINT [ "node", "./dist/index.js" ]
5 changes: 4 additions & 1 deletion services/management/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# ------- BASE -------
FROM soluto/nodegit-alpine:8.1.4 as base

# ------- DEPS -------
FROM base as deps
COPY package.json yarn.lock /tmp/
RUN ln -s /nodegit/node_modules /tmp/node_modules
RUN cd /tmp && yarn --prod

RUN mkdir -p /opt/app && ln -s /tmp/node_modules /opt/app/node_modules

# ------- TEST -------
FROM base as test
FROM deps as test
RUN cd /tmp && yarn

WORKDIR /opt/app
Expand All @@ -21,6 +23,7 @@ FROM base as release

WORKDIR /opt/app
COPY src/ /opt/app/src/
COPY --from=deps /tmp/node_modules /opt/app/node_modules

EXPOSE 3000

Expand Down

0 comments on commit 8f6288f

Please sign in to comment.