mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-29 18:55:49 +00:00
Aws pipeline (#2)
Got the code pipeline nearly done, need to get the updated docker file in main.
This commit is contained in:
parent
517d5e0979
commit
37a0093dd7
4 changed files with 87 additions and 188 deletions
|
@ -1,3 +1,3 @@
|
||||||
FROM openjdk:8-jdk-alpine
|
FROM openjdk:20-ea-17-jdk
|
||||||
COPY target/spring-petclinic-3.0.0-SNAPSHOT.jar spring-petclinic-3.0.0-SNAPSHOT.jar
|
COPY target/spring-petclinic-3.0.0-SNAPSHOT.jar spring-petclinic-3.0.0-SNAPSHOT.jar
|
||||||
ENTRYPOINT ["java","-jar","/spring-petclinic-3.0.0-SNAPSHOT.jar"]
|
ENTRYPOINT ["java","-jar","/spring-petclinic-3.0.0-SNAPSHOT.jar"]
|
||||||
|
|
|
@ -29,6 +29,7 @@ Parameters:
|
||||||
Type: String
|
Type: String
|
||||||
|
|
||||||
Resources:
|
Resources:
|
||||||
|
|
||||||
BlueGreenFlipLambda:
|
BlueGreenFlipLambda:
|
||||||
Type: AWS::Lambda::Function
|
Type: AWS::Lambda::Function
|
||||||
Properties:
|
Properties:
|
||||||
|
@ -44,19 +45,20 @@ Resources:
|
||||||
Role: !GetAtt BlueGreenFlipLambdaRole.Arn
|
Role: !GetAtt BlueGreenFlipLambdaRole.Arn
|
||||||
|
|
||||||
BlueGreenFlipLambdaRole:
|
BlueGreenFlipLambdaRole:
|
||||||
Type: AWS::IAM::Role
|
Type: AWS::IAM::Role
|
||||||
Properties:
|
Properties:
|
||||||
#RoleName: !Sub lambda-${GitHubRepo}-blue-green-swap-role
|
#RoleName: !Sub lambda-${GitHubRepo}-blue-green-swap-role
|
||||||
AssumeRolePolicyDocument:
|
AssumeRolePolicyDocument:
|
||||||
Version: "2012-10-17"
|
Version: "2012-10-17"
|
||||||
Statement:
|
Statement:
|
||||||
- Effect: Allow
|
-
|
||||||
Principal:
|
Effect: Allow
|
||||||
Service:
|
Principal:
|
||||||
- lambda.amazonaws.com
|
Service:
|
||||||
Action:
|
- lambda.amazonaws.com
|
||||||
- sts:AssumeRole
|
Action:
|
||||||
Path: /
|
- sts:AssumeRole
|
||||||
|
Path: /
|
||||||
|
|
||||||
BlueGreenFlipLambdaPolicy:
|
BlueGreenFlipLambdaPolicy:
|
||||||
Type: AWS::IAM::Policy
|
Type: AWS::IAM::Policy
|
||||||
|
@ -65,20 +67,23 @@ Resources:
|
||||||
PolicyDocument:
|
PolicyDocument:
|
||||||
Version: "2012-10-17"
|
Version: "2012-10-17"
|
||||||
Statement:
|
Statement:
|
||||||
- Effect: Allow
|
-
|
||||||
|
Effect: Allow
|
||||||
Action:
|
Action:
|
||||||
- elasticloadbalancing:*
|
- elasticloadbalancing:*
|
||||||
- codepipeline:PutJobFailureResult
|
- codepipeline:PutJobFailureResult
|
||||||
- codepipeline:PutJobSuccessResult
|
- codepipeline:PutJobSuccessResult
|
||||||
Resource: "*"
|
Resource: "*"
|
||||||
- Effect: Allow
|
-
|
||||||
|
Effect: Allow
|
||||||
Action:
|
Action:
|
||||||
- logs:CreateLogGroup
|
- logs:CreateLogGroup
|
||||||
- logs:CreateLogStream
|
- logs:CreateLogStream
|
||||||
- logs:PutLogEvents
|
- logs:PutLogEvents
|
||||||
Resource: arn:aws:logs:*:*:*
|
Resource: arn:aws:logs:*:*:*
|
||||||
Roles:
|
Roles:
|
||||||
- !Ref BlueGreenFlipLambdaRole
|
-
|
||||||
|
!Ref BlueGreenFlipLambdaRole
|
||||||
|
|
||||||
Repository:
|
Repository:
|
||||||
Type: AWS::ECR::Repository
|
Type: AWS::ECR::Repository
|
||||||
|
@ -212,23 +217,21 @@ Resources:
|
||||||
phases:
|
phases:
|
||||||
# install:
|
# install:
|
||||||
# commands:
|
# commands:
|
||||||
# - apt-get update -y
|
# - apt-get update && apt-get -y install python-pip
|
||||||
# - apt-get -y install python-pip
|
# - pip install --upgrade python
|
||||||
# - pip install --upgrade python
|
# - pip install --upgrade awscli
|
||||||
# - pip install --upgrade awscli
|
|
||||||
pre_build:
|
pre_build:
|
||||||
commands:
|
commands:
|
||||||
- printenv
|
- printenv
|
||||||
- echo -n "$CODEBUILD_LOG_PATH" > /tmp/build_id.out
|
- echo -n "$CODEBUILD_LOG_PATH" > /tmp/build_id.out
|
||||||
- printf "%s:%s" "$REPOSITORY_URI" "$(cat /tmp/build_id.out)" > /tmp/build_tag.out
|
- printf "%s:%s" "$REPOSITORY_URI" "$(cat /tmp/build_id.out)" > /tmp/build_tag.out
|
||||||
- printf '{"tag":"%s"}' "$(cat /tmp/build_id.out)" > /tmp/build.json
|
- printf '{"tag":"%s"}' "$(cat /tmp/build_id.out)" > /tmp/build.json
|
||||||
# - $(aws ecr get-login-password)
|
- echo Logging in to Amazon ECR...
|
||||||
|
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin "$(aws sts get-caller-identity --query \"Account\" --output text)".dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com
|
||||||
build:
|
build:
|
||||||
commands:
|
commands:
|
||||||
- ./mvnw package
|
- ./mvnw package -DskipTests
|
||||||
- docker build --tag "$(cat /tmp/build_tag.out)" .
|
- docker build --tag "$(cat /tmp/build_tag.out)" .
|
||||||
# - ./mvnw spring-boot:build-image
|
|
||||||
- docker image tag spring-petclinic:3.0.0-SNAPSHOT "$(cat /tmp/build_tag.out)"
|
|
||||||
post_build:
|
post_build:
|
||||||
commands:
|
commands:
|
||||||
- docker push "$(cat /tmp/build_tag.out)"
|
- docker push "$(cat /tmp/build_tag.out)"
|
||||||
|
@ -239,13 +242,12 @@ Resources:
|
||||||
ComputeType: "BUILD_GENERAL1_SMALL"
|
ComputeType: "BUILD_GENERAL1_SMALL"
|
||||||
Image: "aws/codebuild/standard:6.0"
|
Image: "aws/codebuild/standard:6.0"
|
||||||
Type: "LINUX_CONTAINER"
|
Type: "LINUX_CONTAINER"
|
||||||
|
PrivilegedMode: true
|
||||||
EnvironmentVariables:
|
EnvironmentVariables:
|
||||||
- Name: AWS_DEFAULT_REGION
|
- Name: AWS_DEFAULT_REGION
|
||||||
Value: !Ref AWS::Region
|
Value: !Ref AWS::Region
|
||||||
- Name: REPOSITORY_URI
|
- Name: REPOSITORY_URI
|
||||||
Value: !Sub ${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/${Repository}
|
Value: !Sub ${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/${Repository}
|
||||||
- Name: DOCKER_HOST
|
|
||||||
Value: unix:///var/run/docker.sock
|
|
||||||
Name: !Sub ${AWS::StackName}-codebuildproject
|
Name: !Sub ${AWS::StackName}-codebuildproject
|
||||||
ServiceRole: !Ref CodeBuildServiceRole
|
ServiceRole: !Ref CodeBuildServiceRole
|
||||||
|
|
||||||
|
@ -259,11 +261,11 @@ Resources:
|
||||||
BuildSpec: |
|
BuildSpec: |
|
||||||
version: 0.1
|
version: 0.1
|
||||||
phases:
|
phases:
|
||||||
install:
|
# install:
|
||||||
commands:
|
# commands:
|
||||||
- pip install --upgrade python
|
# - pip install --upgrade python
|
||||||
- pip install --upgrade awscli
|
# - pip install --upgrade awscli
|
||||||
- pip install --upgrade boto3
|
# - pip install --upgrade boto3
|
||||||
pre_build:
|
pre_build:
|
||||||
commands:
|
commands:
|
||||||
- printenv
|
- printenv
|
||||||
|
@ -274,7 +276,7 @@ Resources:
|
||||||
discard-paths: yes
|
discard-paths: yes
|
||||||
Environment:
|
Environment:
|
||||||
ComputeType: "BUILD_GENERAL1_SMALL"
|
ComputeType: "BUILD_GENERAL1_SMALL"
|
||||||
Image: aws/codebuild/python:2.7.12
|
Image: "aws/codebuild/standard:6.0"
|
||||||
Type: "LINUX_CONTAINER"
|
Type: "LINUX_CONTAINER"
|
||||||
EnvironmentVariables:
|
EnvironmentVariables:
|
||||||
- Name: AWS_DEFAULT_REGION
|
- Name: AWS_DEFAULT_REGION
|
||||||
|
@ -415,6 +417,8 @@ Resources:
|
||||||
}
|
}
|
||||||
RunOrder: 3
|
RunOrder: 3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Outputs:
|
Outputs:
|
||||||
PipelineUrl:
|
PipelineUrl:
|
||||||
Value: !Sub https://console.aws.amazon.com/codepipeline/home?region=${AWS::Region}#/view/${Pipeline}
|
Value: !Sub https://console.aws.amazon.com/codepipeline/home?region=${AWS::Region}#/view/${Pipeline}
|
||||||
|
|
|
@ -41,137 +41,13 @@ Parameters:
|
||||||
S3 Bucket used for nested templates
|
S3 Bucket used for nested templates
|
||||||
|
|
||||||
|
|
||||||
Mappings:
|
|
||||||
AWSRegionToAMI:
|
|
||||||
us-east-1:
|
|
||||||
AMI: ami-71ef560b
|
|
||||||
us-east-2:
|
|
||||||
AMI: ami-1b8ca37e
|
|
||||||
us-west-1:
|
|
||||||
AMI: ami-e5cdf385
|
|
||||||
us-west-2:
|
|
||||||
AMI: ami-a64d9ade
|
|
||||||
eu-west-1:
|
|
||||||
AMI: ami-014ae578
|
|
||||||
eu-west-2:
|
|
||||||
AMI: ami-4f8d912b
|
|
||||||
eu-central-1:
|
|
||||||
AMI: ami-4255d32d
|
|
||||||
ap-northeast-1:
|
|
||||||
AMI: ami-3405af52
|
|
||||||
ap-southeast-1:
|
|
||||||
AMI: ami-134e0670
|
|
||||||
ap-southeast-2:
|
|
||||||
AMI: ami-2ab95148
|
|
||||||
ca-central-1:
|
|
||||||
AMI: ami-c802baac
|
|
||||||
|
|
||||||
|
|
||||||
Resources:
|
Resources:
|
||||||
ECSRole:
|
|
||||||
Type: AWS::IAM::Role
|
|
||||||
Properties:
|
|
||||||
Path: /
|
|
||||||
#RoleName: !Sub ecs-${AWS::StackName}
|
|
||||||
AssumeRolePolicyDocument: |
|
|
||||||
{
|
|
||||||
"Statement": [{
|
|
||||||
"Effect": "Allow",
|
|
||||||
"Principal": { "Service": [ "ec2.amazonaws.com" ]},
|
|
||||||
"Action": [ "sts:AssumeRole" ]
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
ManagedPolicyArns:
|
|
||||||
- arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role
|
|
||||||
|
|
||||||
InstanceProfile:
|
|
||||||
Type: AWS::IAM::InstanceProfile
|
|
||||||
Properties:
|
|
||||||
Path: /
|
|
||||||
Roles:
|
|
||||||
- !Ref ECSRole
|
|
||||||
|
|
||||||
SecurityGroup:
|
|
||||||
Type: "AWS::EC2::SecurityGroup"
|
|
||||||
Properties:
|
|
||||||
GroupDescription: !Sub ${AWS::StackName}-hosts
|
|
||||||
SecurityGroupIngress:
|
|
||||||
- SourceSecurityGroupId: !GetAtt LoadBalancer.Outputs.SecurityGroup
|
|
||||||
IpProtocol: -1
|
|
||||||
VpcId: !Ref VpcId
|
|
||||||
|
|
||||||
Cluster:
|
Cluster:
|
||||||
Type: AWS::ECS::Cluster
|
Type: AWS::ECS::Cluster
|
||||||
Properties:
|
Properties:
|
||||||
ClusterName: !Ref AWS::StackName
|
ClusterName: !Ref AWS::StackName
|
||||||
|
|
||||||
AutoScalingGroup:
|
|
||||||
Type: AWS::AutoScaling::AutoScalingGroup
|
|
||||||
Properties:
|
|
||||||
VPCZoneIdentifier:
|
|
||||||
- !Ref Subnet1
|
|
||||||
- !Ref Subnet2
|
|
||||||
LaunchConfigurationName: !Ref LaunchConfiguration
|
|
||||||
MinSize: !Ref ClusterSize
|
|
||||||
MaxSize: !Ref ClusterSize
|
|
||||||
DesiredCapacity: !Ref ClusterSize
|
|
||||||
Tags:
|
|
||||||
- Key: Name
|
|
||||||
Value: !Sub ${AWS::StackName} - ECS Host
|
|
||||||
PropagateAtLaunch: true
|
|
||||||
CreationPolicy:
|
|
||||||
ResourceSignal:
|
|
||||||
Timeout: PT15M
|
|
||||||
UpdatePolicy:
|
|
||||||
AutoScalingRollingUpdate:
|
|
||||||
MinInstancesInService: 1
|
|
||||||
MaxBatchSize: 1
|
|
||||||
PauseTime: PT15M
|
|
||||||
WaitOnResourceSignals: true
|
|
||||||
|
|
||||||
LaunchConfiguration:
|
|
||||||
Type: AWS::AutoScaling::LaunchConfiguration
|
|
||||||
Metadata:
|
|
||||||
AWS::CloudFormation::Init:
|
|
||||||
config:
|
|
||||||
commands:
|
|
||||||
01_add_instance_to_cluster:
|
|
||||||
command: !Sub echo ECS_CLUSTER=${Cluster} > /etc/ecs/ecs.config
|
|
||||||
files:
|
|
||||||
"/etc/cfn/cfn-hup.conf":
|
|
||||||
mode: 000400
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
content: !Sub |
|
|
||||||
[main]
|
|
||||||
stack=${AWS::StackId}
|
|
||||||
region=${AWS::Region}
|
|
||||||
"/etc/cfn/hooks.d/cfn-auto-reloader.conf":
|
|
||||||
content: !Sub |
|
|
||||||
[cfn-auto-reloader-hook]
|
|
||||||
triggers=post.update
|
|
||||||
path=Resources.ContainerInstances.Metadata.AWS::CloudFormation::Init
|
|
||||||
action=/opt/aws/bin/cfn-init -v --region ${AWS::Region} --stack ${AWS::StackName} --resource LaunchConfiguration
|
|
||||||
services:
|
|
||||||
sysvinit:
|
|
||||||
cfn-hup:
|
|
||||||
enabled: true
|
|
||||||
ensureRunning: true
|
|
||||||
files:
|
|
||||||
- /etc/cfn/cfn-hup.conf
|
|
||||||
- /etc/cfn/hooks.d/cfn-auto-reloader.conf
|
|
||||||
Properties:
|
|
||||||
ImageId: !FindInMap [ AWSRegionToAMI, !Ref "AWS::Region", AMI ]
|
|
||||||
InstanceType: !Ref InstanceType
|
|
||||||
IamInstanceProfile: !Ref InstanceProfile
|
|
||||||
SecurityGroups:
|
|
||||||
- !Ref SecurityGroup
|
|
||||||
UserData:
|
|
||||||
"Fn::Base64": !Sub |
|
|
||||||
#!/bin/bash
|
|
||||||
yum install -y aws-cfn-bootstrap
|
|
||||||
/opt/aws/bin/cfn-init -v --region ${AWS::Region} --stack ${AWS::StackName} --resource LaunchConfiguration
|
|
||||||
/opt/aws/bin/cfn-signal -e $? --region ${AWS::Region} --stack ${AWS::StackName} --resource AutoScalingGroup
|
|
||||||
|
|
||||||
LoadBalancer:
|
LoadBalancer:
|
||||||
Type: AWS::CloudFormation::Stack
|
Type: AWS::CloudFormation::Stack
|
||||||
|
@ -198,6 +74,9 @@ Resources:
|
||||||
Repository: !Ref Repository
|
Repository: !Ref Repository
|
||||||
Identifier: "Code2"
|
Identifier: "Code2"
|
||||||
IsProduction: False
|
IsProduction: False
|
||||||
|
Subnet1 : !Ref Subnet1
|
||||||
|
Subnet2 : !Ref Subnet2
|
||||||
|
ALBSg : !GetAtt LoadBalancer.Outputs.SecurityGroup
|
||||||
|
|
||||||
BlueService:
|
BlueService:
|
||||||
Type: AWS::CloudFormation::Stack
|
Type: AWS::CloudFormation::Stack
|
||||||
|
@ -213,6 +92,9 @@ Resources:
|
||||||
Repository: !Ref Repository
|
Repository: !Ref Repository
|
||||||
Identifier: "Code1"
|
Identifier: "Code1"
|
||||||
IsProduction: True
|
IsProduction: True
|
||||||
|
Subnet1 : !Ref Subnet1
|
||||||
|
Subnet2 : !Ref Subnet2
|
||||||
|
ALBSg : !GetAtt LoadBalancer.Outputs.SecurityGroup
|
||||||
|
|
||||||
|
|
||||||
Outputs:
|
Outputs:
|
||||||
|
|
|
@ -31,9 +31,16 @@ Parameters:
|
||||||
IsProduction:
|
IsProduction:
|
||||||
Type: String
|
Type: String
|
||||||
|
|
||||||
|
Subnet1:
|
||||||
|
Type: String
|
||||||
|
|
||||||
|
Subnet2:
|
||||||
|
Type: String
|
||||||
|
|
||||||
|
ALBSg:
|
||||||
|
Type: String
|
||||||
|
|
||||||
Resources:
|
Resources:
|
||||||
|
|
||||||
LoadBalancerListener:
|
LoadBalancerListener:
|
||||||
Type: AWS::ElasticLoadBalancingV2::Listener
|
Type: AWS::ElasticLoadBalancingV2::Listener
|
||||||
Properties:
|
Properties:
|
||||||
|
@ -48,6 +55,7 @@ Resources:
|
||||||
Type: AWS::ElasticLoadBalancingV2::TargetGroup
|
Type: AWS::ElasticLoadBalancingV2::TargetGroup
|
||||||
Properties:
|
Properties:
|
||||||
VpcId: !Ref VpcId
|
VpcId: !Ref VpcId
|
||||||
|
TargetType: ip
|
||||||
Port: !Ref Port
|
Port: !Ref Port
|
||||||
Protocol: HTTP
|
Protocol: HTTP
|
||||||
Matcher:
|
Matcher:
|
||||||
|
@ -77,69 +85,74 @@ Resources:
|
||||||
Conditions:
|
Conditions:
|
||||||
- Field: path-pattern
|
- Field: path-pattern
|
||||||
Values:
|
Values:
|
||||||
- "*"
|
- "*"
|
||||||
ListenerArn: !Ref LoadBalancerListener
|
ListenerArn: !Ref LoadBalancerListener
|
||||||
Priority: 1
|
Priority: 1
|
||||||
|
|
||||||
ECSServiceRole:
|
TaskIamRole:
|
||||||
Type: AWS::IAM::Role
|
Type: AWS::IAM::Role
|
||||||
Properties:
|
Properties:
|
||||||
#RoleName: !Sub ecs-service-${AWS::StackName}
|
|
||||||
Path: /
|
Path: /
|
||||||
AssumeRolePolicyDocument: |
|
AssumeRolePolicyDocument: |
|
||||||
{
|
{
|
||||||
"Statement": [{
|
"Statement": [{
|
||||||
"Effect": "Allow",
|
"Effect": "Allow",
|
||||||
"Principal": { "Service": [ "ecs.amazonaws.com" ]},
|
"Principal": { "Service": [ "ecs-tasks.amazonaws.com" ]},
|
||||||
"Action": [ "sts:AssumeRole" ]
|
"Action": [ "sts:AssumeRole" ]
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
ManagedPolicyArns:
|
ManagedPolicyArns:
|
||||||
- arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceRole
|
- arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly
|
||||||
|
- arn:aws:iam::aws:policy/CloudWatchLogsFullAccess
|
||||||
|
|
||||||
|
SecurityGroup:
|
||||||
|
Type: AWS::EC2::SecurityGroup
|
||||||
|
Properties:
|
||||||
|
GroupDescription: !Sub ${AWS::StackName}
|
||||||
|
SecurityGroupIngress:
|
||||||
|
- SourceSecurityGroupId: !Ref ALBSg
|
||||||
|
IpProtocol: -1
|
||||||
|
VpcId: !Ref VpcId
|
||||||
Service:
|
Service:
|
||||||
Type: AWS::ECS::Service
|
Type: AWS::ECS::Service
|
||||||
Properties:
|
Properties:
|
||||||
Cluster: !Ref Cluster
|
Cluster: !Ref Cluster
|
||||||
Role: !Ref ECSServiceRole
|
|
||||||
DesiredCount: !Ref DesiredCount
|
DesiredCount: !Ref DesiredCount
|
||||||
|
LaunchType: FARGATE
|
||||||
TaskDefinition: !Ref TaskDefinition
|
TaskDefinition: !Ref TaskDefinition
|
||||||
LoadBalancers:
|
LoadBalancers:
|
||||||
- ContainerName: simple-app
|
- ContainerName: simple-app
|
||||||
ContainerPort: 80
|
ContainerPort: 8080
|
||||||
TargetGroupArn: !Ref TargetGroup
|
TargetGroupArn: !Ref TargetGroup
|
||||||
|
NetworkConfiguration:
|
||||||
|
AwsvpcConfiguration:
|
||||||
|
AssignPublicIp: ENABLED #MENTION DISABLED if in private subnet with NAT gateway
|
||||||
|
SecurityGroups:
|
||||||
|
- !GetAtt SecurityGroup.GroupId
|
||||||
|
Subnets:
|
||||||
|
- !Ref Subnet1
|
||||||
|
- !Ref Subnet2
|
||||||
|
|
||||||
TaskDefinition:
|
TaskDefinition:
|
||||||
Type: AWS::ECS::TaskDefinition
|
Type: AWS::ECS::TaskDefinition
|
||||||
Properties:
|
Properties:
|
||||||
#Family: !Sub ${AWS::StackName}-simple-app
|
Cpu: 512
|
||||||
|
Memory: 512
|
||||||
|
NetworkMode: awsvpc
|
||||||
|
RequiresCompatibilities:
|
||||||
|
- FARGATE
|
||||||
|
ExecutionRoleArn: !GetAtt TaskIamRole.Arn
|
||||||
ContainerDefinitions:
|
ContainerDefinitions:
|
||||||
- Name: simple-app
|
- Name: simple-app
|
||||||
Image: !Sub ${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/${Repository}:${Tag}
|
Image: !Sub ${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/${Repository}:${Tag}
|
||||||
EntryPoint:
|
# EntryPoint:
|
||||||
- /usr/sbin/apache2
|
# - /usr/sbin/apache2
|
||||||
- -D
|
# - -D
|
||||||
- FOREGROUND
|
# - FOREGROUND
|
||||||
Essential: true
|
Essential: true
|
||||||
Memory: 128
|
Memory: 512
|
||||||
MountPoints:
|
|
||||||
- SourceVolume: my-vol
|
|
||||||
ContainerPath: /var/www/my-vol
|
|
||||||
PortMappings:
|
PortMappings:
|
||||||
- ContainerPort: 80
|
- ContainerPort: 8080
|
||||||
Environment:
|
Environment:
|
||||||
- Name: Tag
|
- Name: Tag
|
||||||
Value: !Ref Tag
|
Value: !Ref Tag
|
||||||
- Name: busybox
|
|
||||||
Image: busybox
|
|
||||||
EntryPoint:
|
|
||||||
- sh
|
|
||||||
- -c
|
|
||||||
Essential: false
|
|
||||||
Memory: 128
|
|
||||||
VolumesFrom:
|
|
||||||
- SourceContainer: simple-app
|
|
||||||
Command:
|
|
||||||
- /bin/sh -c "while true; do /bin/date > /var/www/my-vol/date; sleep 1; done"
|
|
||||||
Volumes:
|
|
||||||
- Name: my-vol
|
|
||||||
|
|
Loading…
Reference in a new issue