-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
13 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/Dockerfile | ||
/node_modules | ||
/run | ||
*.log | ||
/test |
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,26 +1,40 @@ | ||
FROM node:8.2-alpine | ||
FROM node:8.9-alpine AS build | ||
|
||
MAINTAINER Quintype Developers <[email protected]> | ||
|
||
EXPOSE 3000 | ||
RUN apk update && \ | ||
apk add git | ||
|
||
RUN mkdir /app | ||
WORKDIR /app | ||
|
||
COPY package.json yarn.lock /app/ | ||
RUN npm install -g yarn && \ | ||
yarn install --cache-folder /app/yarn-cache | ||
|
||
ENV NODE_ENV production | ||
COPY . /app | ||
RUN git log -n1 --pretty="Commit Date: %aD%nBuild Date: `date --rfc-2822`%n%h %an%n%s%n" > public/round-table.txt && \ | ||
yarn run compile && \ | ||
rm -rf .node-modules && \ | ||
yarn install --production --cache-folder /app/yarn-cache && \ | ||
rm -rf /app/yarn-cache | ||
|
||
FROM node:8.9-alpine | ||
|
||
MAINTAINER Quintype Developers <[email protected]> | ||
|
||
RUN apk update && \ | ||
apk add htop git curl && \ | ||
apk add curl tini && \ | ||
addgroup -S app && \ | ||
adduser -S -g app app | ||
|
||
ADD . /app | ||
ENV NODE_ENV production | ||
COPY --from=build /app /app | ||
RUN chown -R app:app /app | ||
|
||
USER app | ||
WORKDIR /app | ||
|
||
RUN git log -n1 --pretty="Commit Date: %aD%nBuild Date: `date --rfc-2822`%n%h %an%n%s%n" > public/round-table.txt && \ | ||
npm install yarn && \ | ||
./node_modules/.bin/yarn | ||
|
||
ENV NODE_ENV production | ||
RUN npm run compile | ||
|
||
ENTRYPOINT ["npm"] | ||
CMD ["start"] | ||
ENTRYPOINT ["/sbin/tini", "--"] | ||
CMD ["node", "start.js"] |