From a51e4ce123f2e6743d13112b7896da73b91fcda1 Mon Sep 17 00:00:00 2001 From: Marlon Augusto Heiber Date: Sun, 3 Oct 2021 02:26:32 -0300 Subject: [PATCH] kubernetes --- Dockerfile => ConversaoPeso.Web/Dockerfile | 3 +- k8s/deployment.yaml | 34 ++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) rename Dockerfile => ConversaoPeso.Web/Dockerfile (93%) create mode 100644 k8s/deployment.yaml diff --git a/Dockerfile b/ConversaoPeso.Web/Dockerfile similarity index 93% rename from Dockerfile rename to ConversaoPeso.Web/Dockerfile index dc4bd40..935ee3b 100644 --- a/Dockerfile +++ b/ConversaoPeso.Web/Dockerfile @@ -7,11 +7,12 @@ COPY *.csproj ./ RUN dotnet restore # Copy everything else and build -COPY ../engine/examples ./ +COPY * ./ RUN dotnet publish -c Release -o out # Build runtime image FROM mcr.microsoft.com/dotnet/aspnet:3.1 WORKDIR /app COPY --from=build-env /app/out . +EXPOSE 8080 ENTRYPOINT ["dotnet", "aspnetapp.dll"] \ No newline at end of file diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml new file mode 100644 index 0000000..ef9ea4c --- /dev/null +++ b/k8s/deployment.yaml @@ -0,0 +1,34 @@ +#Deplyment app +apiVersion: apps/v1 +kind: Deployment +metadata: + name: web +spec: + replicas: 1 + selector: + matchLabels: + app: web + template: + metadata: + labels: + app: web + spec: + containers: + - name: web + image: marlonheiber/conversao-peso:v1 + ports: + - containerPort: 8080 +--- +#Service app +apiVersion: v1 +kind: Service +metadata: + name: web +spec: + selector: + app: web + ports: + - port: 80 + targetPort: 8080 + nodePort: 30000 + type: NodePort \ No newline at end of file