Skip to content

Commit 870c5c9

Browse files
authored
Merge pull request #1 from mdelder/mdelder-update-for-icp
Rebase Dockerfile on alpine & clean up entrypoint script
2 parents ec611c1 + 3d74797 commit 870c5c9

File tree

3 files changed

+25
-18
lines changed

3 files changed

+25
-18
lines changed

Dockerfile

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
1-
FROM node
1+
FROM node:boron-alpine
22
EXPOSE 3000
33

4-
RUN apt-get update && \
5-
apt-get -y install jq && \
6-
apt-get clean
4+
RUN apk --update --no-cache add jq curl tar
5+
6+
LABEL org.label-schema.vendor="IBM" \
7+
org.label-schema.name="$IMAGE_NAME" \
8+
org.label-schema.description="$IMAGE_DESCRIPTION" \
9+
org.label-schema.vcs-ref=$VCS_REF \
10+
org.label-schema.vcs-url=$VCS_URL \
11+
org.label-schema.license="Licensed Materials - Property of IBM" \
12+
org.label-schema.schema-version="1.0"
713

814
RUN mkdir -p /usr/src/app
915
WORKDIR /usr/src/app
1016

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

14-
RUN npm install --production && npm cache clean
20+
RUN npm install --production
1521

16-
COPY *.sh /usr/src/app
22+
COPY entrypoint.sh /usr/src/app
23+
RUN chmod +x /usr/src/app/entrypoint.sh
1724

18-
CMD [ "/usr/src/app/run-server.sh"]
25+
CMD [ "/usr/src/app/entrypoint.sh"]

run-server.sh entrypoint.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#!/bin/bash
1+
#!/bin/sh
2+
23
export CONVERSATION_PASSWORD=$(echo "$CONVERSATION_SERVICE_CAR" | jq -r '.password')
34
export CONVERSATION_USERNAME=$(echo "$CONVERSATION_SERVICE_CAR" | jq -r '.username')
4-
echo "CONVERSATION_USERNAME == $CONVERSATION_USERNAME"
5-
echo "CONVERSATION_PASSWORD == $CONVERSATION_PASSWORD"
6-
npm start
5+
echo "npm start"
6+
/usr/local/bin/npm start

car-dashboard-pod.yml watson-conversation.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,34 @@
33
apiVersion: v1
44
kind: Service
55
metadata:
6-
name: bot-son
6+
name: watson-conversation-app
77
labels:
8-
app: bot-son
8+
app: watson-conversation-app
99
tier: frontend
1010
spec:
1111
type: NodePort
1212
ports:
1313
- port: 3000
1414
selector:
15-
app: bot-son
15+
app: watson-conversation-app
1616
tier: frontend
1717
---
1818
# Application to deploy
1919
apiVersion: extensions/v1beta1
2020
kind: Deployment
2121
metadata:
22-
name: bot-son
22+
name: watson-conversation-app
2323
spec:
2424
replicas: 2 # tells deployment to run 2 pods matching the template
2525
template: # create pods using pod definition in this template
2626
metadata:
2727
labels:
28-
app: bot-son
28+
app: watson-conversation-app
2929
tier: frontend
3030
spec:
3131
containers:
32-
- name: bot-son
33-
image: jcantosz/watson
32+
- name: watson-conversation-app
33+
image: mycluster.icp:8500/default/conversation-simple:latest
3434
resources:
3535
requests:
3636
cpu: 100m

0 commit comments

Comments
 (0)