$ COMPOSE_DOCKER_CLI_BUILD=1 docker-compose build
Build docker image for production.
$ docker build -f Dockerfile.prod --secret id=master_key,src=config/master.key .
$ docker-compose up -d
IAM policy for Copilot deployment.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"iam:*",
"servicediscovery:*",
"route53domains:*",
"s3:*",
"ssm:*",
"ecs:*",
"lambda:*",
"route53:*",
"cloudformation:*",
"ecr:*",
"ec2:*"
],
"Resource": "*"
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource": "*"
}
]
}
Build Nginx docker image, and push to ECR.
./scripts/ecr-nginx.sh
Create AWS resources (ex. VPC, ALB, Farge, RDS) with AWS Copilot.
$ ./scripts/copilot-init.sh <env> <domain>
To share EFS between services, fetch EFS configuration from copilot commands bellow.
$ FS_ID=$(copilot env show -n dev --json --resources | jq -r '.resources[] | select(.type | contains("EFS::FileSystem")) | .physicalID')
$ FS_AP=$(copilot svc show -n rails --json --resources | jq -r '.resources.dev[] | select(.type | contains("EFS::AccessPoint")) | .physicalID')
And set these values to storage
section.
storage:
volumes:
sharedEFS:
efs:
id: $FS_ID
auth:
access_point_id: $FS_AP
iam: true
path: /app/public/maintenance
read_only: false
# turn on maintenance mode
$ copilot svc exec --app chronos --command 'bin/maintenance on'
# turn off maintenance mode
$ copilot svc exec --app chronos --command 'bin/maintenance off'
$ ./scripts/copilot-delete.sh
Running a deployment workflow using GitHub CLI.
./scripts/deploy.sh -h
Usage: ./scripts/deploy.sh [flags]
-r, --rails Deploy Rails
-n, --nuxt Deploy Nuxt
-m, --maintenance Maintenance mode on
--branch string Deploy branch name
--env string Deploy environment. dev | staging | production