From 3a253bb0bac28f63936d9acdd3db23e9c732728e Mon Sep 17 00:00:00 2001 From: vandanabhandari Date: Wed, 17 Mar 2021 22:53:40 -0400 Subject: [PATCH] feat(installation, ci, docker): add Dockerfile, updating README for setup of denali-ember container --- .dockerignore | 2 ++ Dockerfile | 15 +++++++++++++++ README.md | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..93f1361 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules +npm-debug.log diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b5df8d6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:14 +# Create app directory +WORKDIR /usr/src/app +# Install app dependencies +# A wildcard is used to ensure both package.json AND package-lock.json are copied +# where available (npm@5+) +COPY package*.json ./ + +RUN npm install +# If you are building your code for production +# RUN npm ci --only=production +# Bundle app source +COPY . . +EXPOSE 9001 +CMD [ "npm", "run", "storybook" ] diff --git a/README.md b/README.md index 127a807..d4331a0 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,38 @@ ember install @denali-design/ember ``` +## Containerizing + +To build docker image locally make sure you have docker agent installed and deamon is running. + +https://docs.docker.com/docker-for-windows/install/ +https://docs.docker.com/docker-for-mac/install/ + +1. Command to build the docker image + +``` +docker build -t denali-ember . +``` + +2. Check docker images + +``` +docker images | grep denali-ember +``` + +3. Run the docker image and optionally map the port + +``` +docker run -p 49160:9001 -d denali-ember +``` + +4. Check docker container is running and you can tail logs using + +``` + docker ps + docker logs -f +``` + ## Contributing See the [Contributing](CONTRIBUTING.md) guide for details.