diff --git a/.deploy/deployment.yaml b/.deploy/deployment.yaml index 23fa89b3..7fe92fab 100644 --- a/.deploy/deployment.yaml +++ b/.deploy/deployment.yaml @@ -67,3 +67,46 @@ spec: - port: __PORT__ targetPort: __PORT__ protocol: TCP +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx-entity + namespace: hypermine-development +spec: + replicas: 1 + + selector: + matchLabels: + app: nginx-entity + template: + metadata: + labels: + app: nginx-entity + spec: + containers: + - name: nginx-entity + image: __GOOGLE_ARTIFACT_URL__/__GOOGLE_PROJECT_ID__/__GOOGLE_ARTIFACT_REPO__/nginx-enity:latest + resources: + limits: + memory: "256m" + cpu: "500m" + ports: + - containerPort: 8080 +--- +apiVersion: v1 +kind: Service +metadata: + name: nginx-entity-service + namespace: hypermine-development + annotations: + cloud.google.com/neg: '{"ingress": true}' + +spec: + type: NodePort + selector: + app: nginx-entity + ports: + - port: 8080 + targetPort: 8080 + protocol: TCP diff --git a/.github/workflows/CI-CD.yaml b/.github/workflows/CI-CD.yaml index b7457a63..47d20405 100644 --- a/.github/workflows/CI-CD.yaml +++ b/.github/workflows/CI-CD.yaml @@ -43,6 +43,15 @@ jobs: docker build -t $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/enity-api-service:latest . docker push $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/enity-api-service:latest + - name: "Docker Build and Push" + env: + GOOGLE_PROJECT_ID: ${{secrets.GOOGLE_PROJECT_ID}} + GOOGLE_ARTIFACT_URL: ${{secrets.GOOGLE_ARTIFACT_URL}} + GOOGLE_ARTIFACT_REPO: ${{secrets.GOOGLE_ARTIFACT_REPO}} + run: + docker build -t $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/nginx-entity:latest ./nginx/ + + docker push $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/nginx-entity:latest Deploy: needs: [Build] diff --git a/nginx/Dockerfile b/nginx/Dockerfile new file mode 100644 index 00000000..35ed02f9 --- /dev/null +++ b/nginx/Dockerfile @@ -0,0 +1,8 @@ +FROM nginx:latest + + + + + +COPY nginx.conf /etc/nginx/nginx.conf +CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 9835fff6..1f72fe9f 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -15,7 +15,7 @@ http { server { listen 8080; - server_name localhost *.localhost; + server_name entity-stage.hypersign.id *.entity-stage.hypersign.id; set $subdomain ""; if ($host ~ ^(.*)\.localhost$) { @@ -23,7 +23,7 @@ http { } location / { - proxy_pass http://ssi-api:3001; + proxy_pass http://entity-api-service.hypermine-development.svc.cluster.local:3001; proxy_set_header X-Subdomain $subdomain; }