Skip to content
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

dockerize the app and add some install instructions #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
npm-debug.log
Dockerfile
.dockerignore
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:12

RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app

WORKDIR /home/node/app

COPY package*.json ./

USER node

RUN npm install

COPY --chown=node:node . .

EXPOSE 6006

# CMD [ "node", "app.js" ]
ENTRYPOINT /bin/bash
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
# sakai-web-components
# sakai-web-components

## Setup with Docker

Run the following commands to get up and running if you have Docker and Docker Compose installed.

` docker-compose run --rm --service-ports node`

Your CLI will then be in the container and your prompt should change to something like `node@asdf123:~/app$`

You can then run these commands from inside the container

`npm install`

`npm run storybook`

You should be able to visit [http://localhost:6006](http://localhost:6006) and see the storybook interface.

ctrl+c will end the storybook server and typing `exit` will return you to your normal CLI prompt.
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3"
services:
node:
build: .
container_name: sakai-web-components
# user: "node"
# working_dir: /home/node/app
# environment:
# - NODE_ENV=production
# - NPM_CONFIG_LOGLEVEL=info
volumes:
- ./:/home/node/app
ports:
- 6006:6006