diff --git a/nodejs/deployment/deployment.yaml b/nodejs/deployment/deployment.yaml new file mode 100644 index 0000000..f92c508 --- /dev/null +++ b/nodejs/deployment/deployment.yaml @@ -0,0 +1,35 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: example-deploy + labels: + app: example-app + annotations: +spec: + selector: + matchLabels: + app: example-app + replicas: 2 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + template: + metadata: + labels: + app: example-app + spec: + containers: + - name: example-app + image: aimvector/nodejs:v1 + imagePullPolicy: Always + ports: + - containerPort: 5000 + resources: + requests: + memory: "64Mi" + cpu: "10m" + limits: + memory: "256Mi" + cpu: "500m" \ No newline at end of file diff --git a/nodejs/deployment/service copy.yaml b/nodejs/deployment/service copy.yaml new file mode 100644 index 0000000..7302b6d --- /dev/null +++ b/nodejs/deployment/service copy.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: example-service + labels: + app: example-app +spec: + type: ClusterIP + selector: + app: example-app + ports: + - protocol: TCP + name: http + port: 80 + targetPort: 5000 \ No newline at end of file diff --git a/nodejs/deployment/service.yaml b/nodejs/deployment/service.yaml new file mode 100644 index 0000000..e69de29 diff --git a/nodejs/dockerfile b/nodejs/dockerfile index 8de9271..56f67bd 100644 --- a/nodejs/dockerfile +++ b/nodejs/dockerfile @@ -1,6 +1,6 @@ FROM node:12.4.0-alpine as dev -RUN mkdir /work/ + WORKDIR /work/ COPY ./src/package.json /work/package.json @@ -8,9 +8,4 @@ RUN npm install COPY ./src/ /work/ - -###########START NEW IMAGE################### - -FROM dev as prod - CMD node .