Fix bug in deployment procedure in AWS CDK and support HTTPS (#1491)
* add cloudfront * modify: healthcheck disable * modify: health check option * modify nodejsbuild * add nodejs version * endpoint configuration * set axios url * remote console.log VITE_PROXY_TARGET * create alb stack * add alb to origin * alb build success * remote baseURL setting * add redirect * change responseHttpStatus to 200 * modify output and readme * modify architecture * add health check path route to cloudfront routing * modified: c9 env name in deploy langflow section * modified : package dependency for pymysql * modified: deploy procedure * modified: deploy procedure (ja) --------- Co-authored-by: nsxshota <nsxshota@amazon.co.jp> Co-authored-by: ymkazuki <ymkazuki@amazon.co.jp> Co-authored-by: Shota Nakamoto <53632932+nsy0328@users.noreply.github.com>
This commit is contained in:
parent
7363df6293
commit
3eeda84d28
18 changed files with 678 additions and 271 deletions
|
|
@ -9,12 +9,10 @@ import { Construct } from 'constructs'
|
|||
|
||||
|
||||
interface ECRProps {
|
||||
cloudmapNamespace: servicediscovery.PrivateDnsNamespace;
|
||||
arch:ecs.CpuArchitecture;
|
||||
}
|
||||
|
||||
export class EcrRepository extends Construct {
|
||||
readonly ecrFrontEndRepository: ecr.Repository
|
||||
readonly ecrBackEndRepository: ecr.Repository
|
||||
|
||||
constructor(scope: Construct, id: string, props: ECRProps) {
|
||||
|
|
@ -22,7 +20,6 @@ export class EcrRepository extends Construct {
|
|||
|
||||
const imagePlatform = props.arch == ecs.CpuArchitecture.ARM64 ? Platform.LINUX_ARM64 : Platform.LINUX_AMD64
|
||||
const backendPath = path.join(__dirname, "../../../../../", "langflow")
|
||||
const frontendPath = path.join(__dirname, "../../../../src/", "frontend")
|
||||
const excludeDir = ['node_modules','.git', 'cdk.out']
|
||||
const LifecycleRule = {
|
||||
tagStatus: ecr.TagStatus.ANY,
|
||||
|
|
@ -30,31 +27,16 @@ export class EcrRepository extends Construct {
|
|||
maxImageCount: 30,
|
||||
}
|
||||
|
||||
// リポジトリ作成
|
||||
this.ecrFrontEndRepository = new ecr.Repository(scope, 'LangflowFrontEndRepository', {
|
||||
repositoryName: 'langflow-frontend-repository',
|
||||
removalPolicy: RemovalPolicy.RETAIN,
|
||||
imageScanOnPush: true,
|
||||
})
|
||||
// Backend ECR リポジトリ作成
|
||||
this.ecrBackEndRepository = new ecr.Repository(scope, 'LangflowBackEndRepository', {
|
||||
repositoryName: 'langflow-backend-repository',
|
||||
removalPolicy: RemovalPolicy.RETAIN,
|
||||
imageScanOnPush: true,
|
||||
})
|
||||
// LifecycleRule作成
|
||||
this.ecrFrontEndRepository.addLifecycleRule(LifecycleRule)
|
||||
this.ecrBackEndRepository.addLifecycleRule(LifecycleRule)
|
||||
|
||||
// Create Docker Image Asset
|
||||
const dockerFrontEndImageAsset = new DockerImageAsset(this, "DockerFrontEndImageAsset", {
|
||||
directory: frontendPath,
|
||||
file:"cdk.Dockerfile",
|
||||
buildArgs:{
|
||||
"BACKEND_URL":`http://backend.${props.cloudmapNamespace.namespaceName}:7860`
|
||||
},
|
||||
exclude: excludeDir,
|
||||
platform: imagePlatform,
|
||||
});
|
||||
const dockerBackEndImageAsset = new DockerImageAsset(this, "DockerBackEndImageAsset", {
|
||||
directory: backendPath,
|
||||
file:"cdk.Dockerfile",
|
||||
|
|
@ -62,12 +44,6 @@ export class EcrRepository extends Construct {
|
|||
platform: imagePlatform,
|
||||
});
|
||||
|
||||
// Deploy Docker Image to ECR Repository
|
||||
new ecrdeploy.ECRDeployment(this, "DeployFrontEndImage", {
|
||||
src: new ecrdeploy.DockerImageName(dockerFrontEndImageAsset.imageUri),
|
||||
dest: new ecrdeploy.DockerImageName(this.ecrFrontEndRepository.repositoryUri)
|
||||
});
|
||||
|
||||
// Deploy Docker Image to ECR Repository
|
||||
new ecrdeploy.ECRDeployment(this, "DeployBackEndImage", {
|
||||
src: new ecrdeploy.DockerImageName(dockerBackEndImageAsset.imageUri),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue