Skip to content

Commit

Permalink
Add yaml config file for service
Browse files Browse the repository at this point in the history
  • Loading branch information
faiyaz26 committed Aug 27, 2018
1 parent c9b0f58 commit edf7732
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM node:8
WORKDIR /usr/src/app
ADD package.json .
ADD config.js .
ADD server.js .
ADD public/ .

RUN npm install
COPY /public /usr/src/app/public
COPY package.json .
COPY config.js .
COPY server.js .


RUN npm install

ENV ENV_NAME prod
ENV REDIS_URL redis
Expand Down
2 changes: 1 addition & 1 deletion k8s/deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
labels:
app: rtn-k8s
spec:
replicas: 3
replicas: 1
selector:
matchLabels:
app: rtn-k8s
Expand Down
14 changes: 14 additions & 0 deletions k8s/svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: rtn-k8s-service
labels:
app: rtn-k8s
spec:
ports:
- port: 80
targetPort: 3000
protocol: TCP
type: LoadBalancer
selector:
app: rtn-k8s
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var io = require('socket.io')(server);
app.use(express.static(path.join(__dirname, 'public')));

app.get('/', function (req, res) {
res.sendfile(__dirname + 'public/index.html');
res.sendFile(__dirname + '/public/index.html');
});


Expand Down

0 comments on commit edf7732

Please sign in to comment.