This file contains 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
# Install Flask | |
pip install flask | |
# Run the python Flask Application locally | |
python ./application.py |
This file contains 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
Flask==2.0.1 |
This file contains 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 flask import Flask | |
application = Flask(__name__) | |
@application.route("/") | |
def hello(): | |
return "Welcome to Onkar's Sample Python Flask App" | |
if __name__ == "__main__": | |
application.run(host='127.0.0.1', port=5000, debug=True) |
This file contains 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
files: | |
/tmp/renew_ssl_cron: | |
mode: "000777" | |
owner: root | |
group: root | |
content: | | |
0 3,15 * * * certbot renew --no-self-upgrade | |
container_commands: | |
1_create_cert_crontab: |
This file contains 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
container_commands: | |
00_permission_hook: | |
command: "chmod +x .platform/hooks/postdeploy/1_generate_certificate.sh" | |
01_permission_hook2: | |
command: "chmod +x .platform/hooks/postdeploy/01_update_filesize_nginx.sh" |
This file contains 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
container_commands: | |
00_permission_hook: | |
command: "chmod +x .platform/hooks/postdeploy/1_generate_certificate.sh" |
This file contains 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
#!/usr/bin/env bash | |
sudo sed -i 's/client_header_timeout/client_max_body_size 20M;\n client_header_timeout/g' /etc/nginx/nginx.conf | |
sudo nginx -s reload | |
echo nginx config update complete |
This file contains 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
Resources: | |
sslSecurityGroupIngress: | |
Type: AWS::EC2::SecurityGroupIngress | |
Properties: | |
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]} | |
IpProtocol: tcp | |
ToPort: 443 | |
FromPort: 443 | |
CidrIp: 0.0.0.0/0 |
This file contains 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
container_commands: | |
00_download_epel: | |
command: "sudo wget -r --no-parent -A 'epel-release-*.rpm' http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/" | |
ignoreErrors: true | |
10_install_epel_release: | |
command: "sudo rpm -Uvh dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-*.rpm" | |
ignoreErrors: true | |
20_enable_epel: | |
command: "sudo yum-config-manager --enable epel*" | |
ignoreErrors: true |
This file contains 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
#!/usr/bin/env bash | |
sudo certbot -n -d YOUR_DOMAIN_NAME --nginx --agree-tos --email YOUR_EMAIL |