Skip to content

Commit

Permalink
Merge pull request #1 from mdelder/mdelder-update-for-icp
Browse files Browse the repository at this point in the history
Rebase Dockerfile on alpine & clean up entrypoint script
  • Loading branch information
mdelder authored Mar 15, 2018
2 parents ec611c1 + 3d74797 commit 870c5c9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
21 changes: 14 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
FROM node
FROM node:boron-alpine
EXPOSE 3000

RUN apt-get update && \
apt-get -y install jq && \
apt-get clean
RUN apk --update --no-cache add jq curl tar

LABEL org.label-schema.vendor="IBM" \
org.label-schema.name="$IMAGE_NAME" \
org.label-schema.description="$IMAGE_DESCRIPTION" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url=$VCS_URL \
org.label-schema.license="Licensed Materials - Property of IBM" \
org.label-schema.schema-version="1.0"

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

RUN curl -L https://github.com/watson-developer-cloud/conversation-simple/archive/master.tar.gz --output /tmp/master.tar.gz && \
tar -xzvf /tmp/master.tar.gz -C /usr/src/app --strip-components 1

RUN npm install --production && npm cache clean
RUN npm install --production

COPY *.sh /usr/src/app
COPY entrypoint.sh /usr/src/app
RUN chmod +x /usr/src/app/entrypoint.sh

CMD [ "/usr/src/app/run-server.sh"]
CMD [ "/usr/src/app/entrypoint.sh"]
8 changes: 4 additions & 4 deletions run-server.sh → entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#!/bin/sh

export CONVERSATION_PASSWORD=$(echo "$CONVERSATION_SERVICE_CAR" | jq -r '.password')
export CONVERSATION_USERNAME=$(echo "$CONVERSATION_SERVICE_CAR" | jq -r '.username')
echo "CONVERSATION_USERNAME == $CONVERSATION_USERNAME"
echo "CONVERSATION_PASSWORD == $CONVERSATION_PASSWORD"
npm start
echo "npm start"
/usr/local/bin/npm start
14 changes: 7 additions & 7 deletions car-dashboard-pod.yml → watson-conversation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,34 @@
apiVersion: v1
kind: Service
metadata:
name: bot-son
name: watson-conversation-app
labels:
app: bot-son
app: watson-conversation-app
tier: frontend
spec:
type: NodePort
ports:
- port: 3000
selector:
app: bot-son
app: watson-conversation-app
tier: frontend
---
# Application to deploy
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: bot-son
name: watson-conversation-app
spec:
replicas: 2 # tells deployment to run 2 pods matching the template
template: # create pods using pod definition in this template
metadata:
labels:
app: bot-son
app: watson-conversation-app
tier: frontend
spec:
containers:
- name: bot-son
image: jcantosz/watson
- name: watson-conversation-app
image: mycluster.icp:8500/default/conversation-simple:latest
resources:
requests:
cpu: 100m
Expand Down

0 comments on commit 870c5c9

Please sign in to comment.