Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 1.63 KB

milestone_simple_app_deployment.md

File metadata and controls

30 lines (21 loc) · 1.63 KB

Manual app deployment

In this tutorial, you will manually deploy the NetflixMovieCatalog service on an AWS virtual machine.

  1. In an AWS account, create an EC2 instance (if haven't done yet).

  2. Run the NetflixMovieCatalog within your instance as a Linux service1 that starts automatically when the instance is starting. Create Python venv and install dependencies if needed.

  3. In Route 53, configure a subdomain in the hosted zone of your domain to route traffic your instance IP.

  4. Access the service domain via your browser and make sure it's accessible, open relevant port in your instance's Security Group.

  5. Now, configure your Flask application to accept only HTTPS traffic by generating a self-signed certificate:

    openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes

    Then, update the Flask app code to use the certificate, as follows:

    - app.run(port=8080, host='0.0.0.0')
    + app.run(port=8080, host='0.0.0.0', ssl_context=('cert.pem', 'key.pem'))

    While cert.pem and key.pem are paths to your generated certificate and private key.

  6. Visit your service via your browser by: https://your-subdomain.devops-days-upes.com:8080 (change your-subdomain accordingly).

Footnotes

  1. Linux services discussed here