Skip to main content

cloud-run-compose

Project description

cloud-run-compose

Install

pip3 install cloud-run-compose

Requirements

  • terraform in PATH
  • docker-compose in PATH
  • a google cloud dervice account .json file

Usage

Download a service account json from the console, with the cloud run persmissions, place it in ./account.json

Use the following docker-compose.yml file

version: '3'

services:
    example-cloudrun-compose:
        image: gcr.io/cloudrun/hello
        expose:
            - 8080
        environment:
            URL_0: 'http://mongoke/'
            URL_1: 'http://server'
    example-cloudrun-compose2:
        image: gcr.io/cloudrun/hello
        expose:
            - 8080

Run the following command to deploy the services

compose --project {your-project} --credentials ./account.json

The command will generate a main.tf file in the working directory, to deploy the plan run

terraform apply

The services will be deployed in google cloud run and will be available at url like

https://{service-name}-zakzcx4zxq-uc.a.run.app

Build and push

If you want to also build and push the services you can use the --build flag, it will

  • build the service using the docker-compose cache
  • push the image

compose --build --project {your-project} --credentials ./account.json

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloud-run-compose-1.0.1.tar.gz (4.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page