GithubHelp home page GithubHelp logo

zaletskyi / cloud-run-compose Goto Github PK

View Code? Open in Web Editor NEW

This project forked from remorses/cloud-run-compose

0.0 2.0 0.0 42.53 MB

Generate Google Cloud Run terraform plan from a docker-compose file

Dockerfile 1.44% Python 85.43% Makefile 2.01% HCL 11.13%

cloud-run-compose's Introduction

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

cloud-run-compose's People

Contributors

remorses avatar bump-version avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.