Skip to content

Commit

Permalink
tested container-gcp-typescript with pulumi up
Browse files Browse the repository at this point in the history
  • Loading branch information
diana esteves committed May 10, 2024
1 parent 971d1eb commit f6c7cc7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
25 changes: 12 additions & 13 deletions container-gcp-typescript/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as pulumi from "@pulumi/pulumi";
import * as dockerBuild from "@pulumi/docker-build";
import * as gcp from "@pulumi/gcp";
import * as docker from "@pulumi/docker";
import * as pulumi from "@pulumi/pulumi";
import * as random from "@pulumi/random";

// Import the program's configuration settings.
Expand Down Expand Up @@ -41,17 +41,16 @@ let repoUrl = pulumi.concat(location, "-docker.pkg.dev/", project, "/", reposito
// Create a container image for the service.
// Before running `pulumi up`, configure Docker for authentication to Artifact Registry
// as described here: https://cloud.google.com/artifact-registry/docs/docker/authentication
const image = new docker.Image("image", {
imageName: pulumi.concat(repoUrl, "/", imageName),
build: {
context: appPath,
platform: "linux/amd64",
args: {
// Cloud Run currently requires x86_64 images
// https://cloud.google.com/run/docs/container-contract#languages
DOCKER_DEFAULT_PLATFORM: "linux/amd64",
},
const image = new dockerBuild.Image("image", {
push: true,
tags: [pulumi.concat(repoUrl, "/", imageName)],
context: {
location: appPath,

},
platforms: [
dockerBuild.Platform.Linux_amd64
],
});

// Create a Cloud Run service definition.
Expand All @@ -61,7 +60,7 @@ const service = new gcp.cloudrun.Service("service", {
spec: {
containers: [
{
image: image.repoDigest,
image: image.ref,
resources: {
limits: {
memory,
Expand Down
12 changes: 6 additions & 6 deletions container-gcp-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"name": "${PROJECT}",
"main": "index.ts",
"devDependencies": {
"@types/node": "^18",
"typescript": "^5.0.0"
"@types/node": "^18.19.33",
"typescript": "^5.4.5"
},
"dependencies": {
"@pulumi/docker": "^4.2.3",
"@pulumi/gcp": "^7.0.0",
"@pulumi/random": "^4.0.0",
"@pulumi/pulumi": "^3.113.0"
"@pulumi/docker-build": "^0.0.2",
"@pulumi/gcp": "^7.21.2",
"@pulumi/pulumi": "^3.115.2",
"@pulumi/random": "^4.16.1"
}
}

0 comments on commit f6c7cc7

Please sign in to comment.