Skip to content

Commit

Permalink
build(docker): Add comments to the docker config files to make them e…
Browse files Browse the repository at this point in the history
…asy to understand.
  • Loading branch information
ryanoglesby08 committed Jul 26, 2017
1 parent 971295b commit 86f8187
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
23 changes: 22 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
# 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:6-alpine

COPY . /app
# Set the working directory for following commands.
WORKDIR /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 package.json yarn.lock .npmrc ./

# Install dependencies.
RUN yarn install

# 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 yarn build

# The entrypoint configures the container to be run as an executable.
# Arguments supplied on the command line will be forwarded onto the entrypoint.
ENTRYPOINT ["yarn"]
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# The docker-compose.yml describes all the services in our application. While Docker Compose is best suited for
# multi-container applications, we can use it to simplify our interaction with Docker.
# https://docs.docker.com/compose/overview/

# `docker-compose build` --> Build the image. Do this first.
# `docker images` --> View the image you just built

# `docker-compose run lib <command>` --> <command> and any arguments will be forwarded onto the Dockerfile entrypoint, "yarn".
# `docker-compose run lib test` --> Run tests.
# `docker-compose run --service-ports lib start:styleguide` --> Start the styleguidist dev server.

version: '3'
services:
lib:
Expand Down

0 comments on commit 86f8187

Please sign in to comment.