mike
mike

Reputation: 1863

docker-compose.yml in Google Cloud Run

I have a large understanding problem when it comes to docker-compose, Dockerfile and how GCP's service Cloud Run works. This makes me unable to advance in a project I have and I am litteraly out of things to try.

I have a docker-compose.yml file with the following content:

version: '2'

services:

    # The Application
    app:
        container_name: laravel_app
        build:
            context: ./
            dockerfile: docker/app.dockerfile
        volumes:
            - ./storage:/var/www/storage

    # The Web Server
    web:
        container_name: nginx_server
        build:
            context: ./
            dockerfile: docker/web.dockerfile
        volumes:
        - ./storage/logs/:/var/log/nginx
        ports:
        - 8080:80

As you can see, it is pretty simple, two services one for the app with php and one for the server. Both have their own dockerfiles and the build is correct. Locally everything works, no issue there.

I would now like to deploy those services in a Cloud Run service on GCP. After digging I saw that it is probably only possible to deploy a service with a single Dockerfile. Is there no way to deploy docker-compose.yml containers to Cloud Run? Should I use another service?

Upvotes: 23

Views: 24209

Answers (1)

guillaume blaquiere
guillaume blaquiere

Reputation: 75940

The immediate answer is: no it won't work as-is! You have to update your packaging.

yes, it's a lot of rework... Or you can use a traditional IaaS for this, with a VM but you lose all the benefit of the scalability and the serverless features.

Upvotes: 43

Related Questions