diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4486246 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM node:14.16.1-alpine3.13 +WORKDIR /app +COPY package*.json ./ +RUN npm install +COPY . . +EXPOSE 8080 +CMD ["node", "index.js"] diff --git a/index.js b/index.js index 43b1a71..a5564cb 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,4 @@ +# Ta tudo certo const express = require('express'); const os = require('os') const app = express(); diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml new file mode 100644 index 0000000..2c74122 --- /dev/null +++ b/k8s/deployment.yaml @@ -0,0 +1,19 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: swagger +spec: + replicas: 2 + selector: + matchLabels: + app: swagger + template: + metadata: + labels: + app: swagger + spec: + containers: + - name: site + image: cadu1982/api-conversao + ports: + - containerPort: 80 diff --git a/k8s/service.yaml b/k8s/service.yaml new file mode 100644 index 0000000..3e32ea8 --- /dev/null +++ b/k8s/service.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Service +metadata: + name: swagger-service +spec: + selector: + app: swagger + ports: + - port: 80 + type: NodePort