<p>I'm building an application written in PHP/Symfony4. I have prepared an API service and some services written in NodeJS/Express.
I'm configuring server structure with Google Cloud Platform. The best idea, for now, is to have multizone multi-clusters configuration with the load balancer.</p>

<p>I was using this link <a href="https://github.com/GoogleCloudPlatform/k8s-multicluster-ingress/tree/master/examples/zone-printer" rel="nofollow noreferrer">https://github.com/GoogleCloudPlatform/k8s-multicluster-ingress/tree/master/examples/zone-printer</a> as a source for my configuration. But now I don't know how to upload/build docker-compose.yml do GCR which can be used in Google Kubernetes.</p>

<pre><code>version: '3'
services:
php:
    image: gcr.io/XXX/php
    build: build/php
    expose:
        - '9000'
    volumes:
        - ./symfony:/var/www/html/symfony:cached
        - ./logs:/var/log
 web:
    image: gcr.io/XXX/nginx
    build: build/nginx
    restart: always
    ports:
        - "81:80"
    depends_on:
        - php
    volumes:
        - ./symfony:/var/www/html/symfony:cached
        - ./logs:/var/log/nginx
</code></pre>

<p>I need to have a single container GCR.io/XXX/XXX/XXX for kubernetes-ingress configuration. Should I use docker-compose.yml or find something else? Which solution will be best?</p>

<p>docker-compose and Kubernetes declarations are not compatible with each other. If you want to use Kubernetes you can use a <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod/" rel="nofollow noreferrer">Pod</a> with 2 containers (according to your example). If you want to take it a step further, you can use a Kubernetes <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">Deployment</a> that can manage your pod replicas, in case you are using multiple replicas.</p>

<p>Something like this:</p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-deployment
  labels:
    app: myapp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
    spec:
      containers:
      - name: php
        image: gcr.io/XXX/php
        ports:
        - containerPort: 9000
        volumeMounts:
        - mountPath: /var/www/html/symfony
          name: symphony
        - mountPath: /var/log
          name: logs
      - name: web
        image: gcr.io/XXX/nginx
        ports:
        - containerPort: 80
        volumeMounts:
        - mountPath: /var/www/html/symfony
          name: symphony
        - mountPath: /var/log
          name: logs
      volumes:
      - name: symphony
        hostPath:
          path: /home/symphony
      - name: logs
        hostPath:
          path: /home/logs
</code></pre>

<p>Even further, you can remove your web container and use <a href="https://github.com/kubernetes/ingress-nginx" rel="nofollow noreferrer">nginx ingress controller</a>. More about Kubernetes Ingresses <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">here</a></p>
