Skip to main content

cloud-run-compose

Deploy a stack of services to Cloud Rus using the docker-compose syntax.

Creates a terraform plan based on the docker-compose configuration.

Missing docker-compose features

  • service discovery
  • volumes
  • non https traffic

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

TODO

  • add private option in labels
  • only support remote bucket usage
  • add constraints of concurrency, memory, cpu, maxScale via labels

Metadata

Release files for cloud-run-compose 1.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cloud-run-compose 1.0.6
File Size Uploaded Provenance
cloud-run-compose-1.0.6.tar.gz 6.3 kB Without provenance Details

Release files / cloud-run-compose-1.0.6.tar.gz

Download URL cloud-run-compose-1.0.6.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d04fda0ea65aca0506b6f937f212f1f26908724f0e9b1c3a089168a85e18bfaa
BLAKE2b-256 checksum
How to use checksums
38dbd583b9a1d0c5be3d96d5fb425c59ca9682e5c761773014812d03d912201a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

Security for cloud-run-compose 1.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page