Skip to content

Commit

Permalink
feat(cdk-docker-cluster): support env
Browse files Browse the repository at this point in the history
  • Loading branch information
thijsdaniels committed Jun 25, 2024
1 parent ec808dc commit 17d19ae
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/perfect-eels-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@codedazur/cdk-docker-cluster": minor
---

Buildtime and runtime environment variables are now supported.
5 changes: 5 additions & 0 deletions .changeset/rotten-laws-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@codedazur/cdk-next-app": patch
---

The version of the DockerCluster dependency is now explicit.
6 changes: 6 additions & 0 deletions packages/cdk-docker-cluster/src/constructs/DockerCluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export interface DockerClusterProps {
};
cpu?: ApplicationLoadBalancedFargateServiceProps["cpu"];
memory?: ApplicationLoadBalancedFargateServiceProps["memoryLimitMiB"];
environment?: {
buildtime?: Record<string, string>;
runtime?: Record<string, string>;
};
}

/**
Expand All @@ -38,6 +42,7 @@ export class DockerCluster extends Construct {
exclude: ["**/cdk.out"],
buildSecrets: props.secrets,
platform: Platform.LINUX_AMD64,
buildArgs: props.environment?.buildtime,
});

const desiredTasks =
Expand All @@ -52,6 +57,7 @@ export class DockerCluster extends Construct {
// image: ContainerImage.fromEcrRepository(image.repository, image.imageTag),
image: ContainerImage.fromDockerImageAsset(image),
containerPort: props.port,
environment: props.environment?.runtime,
},
circuitBreaker: {
enable: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/cdk-next-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"test": "vitest run --passWithNoTests"
},
"dependencies": {
"@codedazur/cdk-docker-cluster": "*"
"@codedazur/cdk-docker-cluster": "^0.3.0"
},
"peerDependencies": {
"aws-cdk-lib": ">=2",
Expand Down

0 comments on commit 17d19ae

Please sign in to comment.