This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a script that will use the AWS Route53 CLI to insert DNS TXT records for Let's Encrypt DNS validation | |
echo 'aws route53 wait resource-record-sets-changed --id \ | |
$(aws route53 change-resource-record-sets --hosted-zone-id \ | |
"$(aws route53 list-hosted-zones-by-name --dns-name $2. | |
--query HostedZones[0].Id --output text)" \ | |
--query ChangeInfo.Id | |
--output text \ | |
--change-batch "{ | |
\"Changes\": [{ | |
\"Action\": \"$1\", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fastcgi_cache_path /dev/shm levels=1:2 keys_zone=laravel:100m; | |
fastcgi_cache_key "$scheme$request_method$host$request_uri$query_string"; | |
server { | |
listen 80; | |
server_name laravelaws.com; | |
rewrite ^ https://$server_name$request_uri? permanent; | |
} | |
server { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
app: | |
build: | |
context: . | |
dockerfile: Dockerfile | |
networks: | |
- network | |
links: | |
- postgres | |
- elasticsearch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create an IAM role | |
aws iam create-role --role-name Laravel-EC2-Role \ | |
--assume-role-policy-document '{"Version":"2012-10-17","Statement":[{"Sid":"","Effect":"Allow","Principal":{"Service":"ec2.amazonaws.com"},"Action":"sts:AssumeRole"}]}' | |
# Add an IAM policy granting access to CloudWatch | |
aws iam put-role-policy --role-name Laravel-EC2-Role --policy-name Laravel-CloudWatch-EC2-Permissions \ | |
--policy-document '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":["logs:CreateLogStream","cloudwatch:PutMetricData","ec2:DescribeTags","logs:DescribeLogStreams","logs:CreateLogGroup","logs:PutLogEvents","ssm:GetParameter"],"Resource":"*"}]}' | |
# Add an IAM policy granting access to your S3 bucket | |
aws iam put-role-policy --role-name Laravel-EC2-Role --policy-name Laravel-S3-EC2-Permissions \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
networks: | |
network: | |
driver: bridge | |
services: | |
app: | |
build: | |
context: . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.1-fpm | |
# Update packages and install composer and PHP dependencies. | |
RUN apt-get update && \ | |
DEBIAN_FRONTEND=noninteractive apt-get install -y \ | |
postgresql-client \ | |
libpq-dev \ | |
libfreetype6-dev \ | |
libjpeg62-turbo-dev \ | |
libmcrypt-dev \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nginx | |
ADD deploy/nginx/nginx.conf /etc/nginx/ | |
ADD deploy/nginx/default.conf /etc/nginx/conf.d/ | |
ADD public /usr/share/nginx/html | |
WORKDIR /usr/share/nginx/html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fastcgi_cache_path /dev/shm levels=1:2 keys_zone=laravel:100m; | |
fastcgi_cache_key "$scheme$request_method$host$request_uri$query_string"; | |
server { | |
listen 80 default_server; | |
server_name laravel.info; | |
root /usr/share/nginx/html/; | |
index index.php index.html; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker-machine create -d amazonec2 \ | |
--amazonec2-access-key $AWS_ACCESS_KEY --amazonec2-secret-key $AWS_SECRET_KEY \ | |
--amazonec2-instance-type t2.large --amazonec2-region us-east-1 laravel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ArtifactBucket: | |
Type: AWS::S3::Bucket | |
DeletionPolicy: Retain | |
Pipeline: | |
Type: AWS::CodePipeline::Pipeline | |
Properties: | |
RoleArn: !GetAtt CodePipelineServiceRole.Arn | |
ArtifactStore: | |
Type: S3 |