-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make build and Dockerfile according to serlo's practices
- Loading branch information
1 parent
4926e1e
commit c73b8c2
Showing
3 changed files
with
6,165 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
FROM node:12 | ||
ENV CACHE_KEYS all | ||
ENV CACHE_KEYS_RETRIES 2 | ||
WORKDIR /app | ||
FROM node:12 as dev-dependencies | ||
WORKDIR /usr/src/app | ||
COPY package.json . | ||
COPY yarn.lock . | ||
RUN yarn --frozen-lockfile --production=false --silent | ||
|
||
FROM node:12 as prod-dependencies | ||
WORKDIR /usr/src/app | ||
ENV NODE_ENV production | ||
COPY package.json . | ||
COPY yarn.lock . | ||
COPY src/ ./src | ||
RUN yarn --frozen-lockfile --production=true --silent | ||
|
||
FROM dev-dependencies as build | ||
COPY src src | ||
COPY index.ts . | ||
RUN yarn install --frozen-lockfile | ||
CMD ["yarn", "updatecache"] | ||
RUN yarn build | ||
|
||
FROM prod-dependencies as release | ||
ENV CACHE_KEYS all | ||
ENV CACHE_KEYS_RETRIES 2 | ||
COPY --from=build /usr/src/app/dist dist | ||
ENTRYPOINT ["node", "dist"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.