-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dockerfile-testt #20
base: master
Are you sure you want to change the base?
dockerfile-testt #20
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# The Dockerfile is the description of all the commands to run to assemble the image. | ||
# Read about all the commands here: https://docs.docker.com/engine/reference/builder/ | ||
|
||
# We also have a docker-compose.yml file, which is used to build and run this Docker image. | ||
|
||
|
||
# Start from the official Node 6 alpine image. https://hub.docker.com/_/node/ | ||
FROM node:8 | ||
|
||
# Disable update check | ||
ENV NO_UPDATE_NOTIFIER=true | ||
|
||
# Set the working directory for following commands. | ||
ENV HOME=/app | ||
WORKDIR /app | ||
|
||
# Add a user so that we don't run as root: | ||
# https://github.com/telusdigital/reference-architecture/blob/3ff683dd68b247ac9a3febda828105fe52cd9390/delivery/docker.md#root-vs-user-mode | ||
RUN set -ex && \ | ||
adduser node root && \ | ||
chmod g+w /app | ||
|
||
# Copy only the files necessary to install dependencies into the working directory. | ||
# Docker builds the image in layers and caches them. Because the app files change more often than the dependencies, we | ||
# copy the app files only after we install the depencendies. | ||
COPY .npmrc package.json package-lock.json lerna.json ./ | ||
|
||
# Install git, which is necessary for the install process. | ||
RUN apt-get update && \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Finding of type dockerfiles detected. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Finding of type dockerfiles detected. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Finding of type dockerfiles detected. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Finding of type dockerfiles detected. |
||
apt-get install git | ||
|
||
# Install dependencies. | ||
# `npm run gitbook:install` will happen in the "prepare" hook, right after `npm ci` | ||
RUN set -ex && \ | ||
npm ci | ||
|
||
# Copy all source and test files into the working directory. | ||
# We use a .dockerignore file to prevent unnecessary or large files from being inadvertently copied. | ||
COPY . /app | ||
|
||
# Build the app. | ||
RUN npm run gitbook:install && \ | ||
npx lerna bootstrap --hoist && \ | ||
npm run build -- --all && \ | ||
./scripts/ci-build-docs.sh \ | ||
rm .npmrc | ||
|
||
# Set the container's user to the newly created one. | ||
USER node | ||
|
||
# The entrypoint configures the container to be run as an executable. | ||
# Arguments supplied on the command line will be forwarded onto the entrypoint. | ||
ENTRYPOINT ["npm", "run"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finding of type dockerfiles detected.
Healthcheck Instruction Missing
Ensure that HEALTHCHECK is being used. The HEALTHCHECK instruction tells Docker how to test a container to check that it is still working