This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| GCP_PROJECT=$(gcloud config list --format 'value(core.project)') | |
| gcloud builds submit --tag gcr.io/$GCP_PROJECT/hellodotnet | |
| gcloud run deploy hellodotnet \ | |
| --image gcr.io/$GCP_PROJECT/hellodotnet \ | |
| --platform managed \ | |
| --no-allow-unauthenticated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dotnet new -i Google.Cloud.Functions.Templates::1.0.0-alpha07 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir HelloFunctions | |
| cd HelloFunctions | |
| dotnet new gcf-http |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Deploy your container to Cloud Run | |
| gcloud run deploy helloruby --image gcr.io/$GCP_PROJECT/helloruby \ | |
| --platform managed \ | |
| --allow-unauthenticated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Set env var "GCP_PROJECT" to our project name | |
| GCP_PROJECT=$(gcloud config list --format 'value(core.project)' 2>/dev/null) | |
| # Build and upload your image in Google Container Registry | |
| gcloud builds submit --tag gcr.io/$GCP_PROJECT/helloruby |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ruby:2.7 | |
| WORKDIR /app | |
| COPY . . | |
| RUN gem install --no-document bundler \ | |
| && bundle config --local frozen true \ | |
| && bundle config --local without "development test" \ | |
| && bundle install | |
| ENTRYPOINT ["bundle", "exec", "functions-framework", "--target=hello"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install the functions_framework gem and other dependencies | |
| bundle install | |
| # Start the web server in the foreground | |
| bundle exec functions-framework --target hello |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "functions_framework" | |
| FunctionsFramework.http("hello") do |request| | |
| "Hello, world!\n" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM hayd/alpine-deno:1.0.0-rc2 | |
| WORKDIR /app | |
| # These steps will be re-run upon each file change in your working directory: | |
| COPY . ./ | |
| # Added to ENTRYPOINT of base image. | |
| CMD ["run", "--allow-env", "--allow-net", "main.ts"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { serve } from "https://deno.land/[email protected]/http/server.ts"; | |
| import "https://deno.land/x/dotenv/mod.ts"; | |
| const PORT = Deno.env.get('PORT') || 8080; | |
| const s = serve(`0.0.0.0:${PORT}`); | |
| const body = new TextEncoder().encode("Hello, Deno\n"); | |
| console.log(`Server started on port ${PORT}`); | |
| for await (const req of s) { | |
| req.respond({ body }); |