diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +node_modules/ 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/k8s/web/deployment.yaml b/k8s/web/deployment.yaml new file mode 100644 index 0000000..8319943 --- /dev/null +++ b/k8s/web/deployment.yaml @@ -0,0 +1,36 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: api-conversao +spec: + selector: + matchLabels: + app: api-conversao + template: + metadata: + labels: + app: api-conversao + spec: + containers: + - name: movies + image: thglex/api-conversao:v1 + ports: + - containerPort: 8080 +apiVersion: apps/v1 +kind: Deployment +metadata: + name: api-conversao +spec: + selector: + matchLabels: + app: api-conversao + template: + metadata: + labels: + app: api-conversao + spec: + containers: + - name: movies + image: thglex/api-conversao:v1 + ports: + - containerPort: 8080 diff --git a/k8s/web/service.yaml b/k8s/web/service.yaml new file mode 100644 index 0000000..096c6ec --- /dev/null +++ b/k8s/web/service.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + name: api-conversao +spec: + selector: + app: api-conversao + ports: + - port: 8080 + targetPort: 8080 + nodePort: 30000 + type: NodePort +apiVersion: v1 +kind: Service +metadata: + name: api-conversao +spec: + selector: + app: api-conversao + ports: + - port: 8080 + targetPort: 8080 + nodePort: 30000 + type: NodePort