Skip to content

Commit

Permalink
[SDPA-682] Add Bay
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-yao committed Jul 18, 2018
1 parent 37ef94c commit 5e02074
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 2 deletions.
Empty file added .circleci/config.yml
Empty file.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git
.idea
*.md
docker-compose*
node_modules/
npm-debug.log
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM amazeeio/node:8-builder as builder
COPY package.json package-lock.json /app/
COPY packages /app/packages
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD 1
RUN npm install

FROM amazeeio/node:8
COPY --from=builder /app/node_modules /app/node_modules
COPY . /app/

RUN mkdir -p /app/node_modules/.cache && fix-permissions /app/node_modules/.cache

ENV HOST 0.0.0.0
EXPOSE 3000

CMD ["npm", "start"]
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ npm test

Before commit changes, run test first. If new Ripple components changed, we should update snapshots by `npm test -- -u`. Then add it in commit.

### Build Setup

### Bay

- `npm run bay:start` - build and start local development environment.
- `npm run bay:stop` - stop all Bay containers.
- `npm run bay:destroy` - stop and remove all Bay containers.
- `npm run bay:logs` - get logs from all running Bay containers.
- `npm run bay:cli` - run a command in `node` container. Example: `npm run bay:cli -- ls -al`.
- `npm run bay:pull` - pull latest Bay containers.

## Export as a Static App

We can export this Ripple storybook site as a stacic app.
Expand Down
14 changes: 14 additions & 0 deletions docker-compose.local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '2'
services:
ripple:
networks:
- amazeeio-network
- default
volumes:
- .:/app:delegated
- /app/node_modules
environment:
LAGOON_ENVIRONMENT_TYPE: 'local'
networks:
amazeeio-network:
external: true
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '2'
services:
ripple:
build:
context: .
dockerfile: Dockerfile
networks:
- default
labels:
lagoon.type: node
environment:
- AMAZEEIO_URL=ripple.docker.amazee.io
- AMAZEEIO=AMAZEEIO
- AMAZEEIO_HTTP_PORT=3000
ports:
- "9001:3000"
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dpc-sdp/ripple",
"version": "0.1.0",
"version": "0.1.1",
"description": "Ripple",
"contributors": [
"Tim Yao <[email protected]>"
Expand All @@ -12,7 +12,14 @@
"test": "NODE_ENV=test jest",
"storybook": "start-storybook -p 3000 -c .storybook -s ./static",
"build-storybook": "build-storybook -c .storybook -s ./static",
"start": "npm run storybook"
"start": "npm run storybook",
"bay:start": "docker-compose up -d",
"bay:rebuild-full": "docker-compose up -d --build --force-recreate",
"bay:restart": "docker-compose restart",
"bay:stop": "docker-compose stop",
"bay:destroy": "docker-compose down -v",
"bay:logs": "docker-compose logs",
"bay:cli": "docker exec -i $(docker-compose ps -q app)"
},
"dependencies": {
"@dpc-sdp/ripple-anchor-links": "file:packages/Molecules/AnchorLinks",
Expand Down

0 comments on commit 5e02074

Please sign in to comment.