Skip to content

codylane/devops-nginx

Repository files navigation

devops-nginx

Build Status

Getting Started

Environment Variables

Environment variable Default Required Description
LANG en_US.UTF-8 Y Locale
NGINX_HOST devops-nginx Y The DNS hostname to use for serving content
NGINX_PORT 80 Y The TCP port (inside the container)
NGINX_EXPOSED_PORT 80 Y The TCP port served via your docker host (external facing)
EXTERNAL_IP N The external ip address that may be used to serve your content
AWS_ACCESS_KEY_ID "${AWS_ACCESS_KEY_ID:-}" Y This is your AWS access key id provided in the IAM console
AWS_SECRET_ACCESS_KEY "${AWS_SECRET_ACCESS_KEY:-}" Y This is your AWS secret access key provided in the IAM console
AWS_REGION "${AWS_REGION:-us-east-2}" N This is the default AWS region you want to use
MY_DOMAIN "${MY_DOMAIN:-codylane-devops.com}" Y The domain to use when configuring NGINX. codylane-devops.com is a private domain

The following variables are customizable outside of envs/common

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_REGION
  • MY_DOMAIN

Usage

  • Before running the container, we need to first source an environment configuration.

  • All environment variables for this demo are controlled in an environment directory called envs and configuration can be inherited or modified as desired. Please see Environment Variables for all the variables you can set.

  • Once we have the right configuration files in place, we can source that environment.

. envs/common

  • Next, we initialize the awscli to use our AWS account.
  • NOTE: This utility is not smart enough to update AWS credentials if the files already exist on disk. If they do, you will need to modify them by hand. See the Makefile for details.
make init
  • Then we source source the python environment that will provision our infrastructure in EC2.
. ./init.sh

How to deploy this code to EC2

make ec2

How to run the services on your local workstation

Ensure all the prerequisites are installed

make prereqs

A one-shot command to [clean, init, build, run] the container

make

Build the container

  • This step creates the base image for serving up our demo via nginx.
make build

Remove and delete the container

  • NOTE: This step does not delete files or directories for the bind mounted storage as noted in the volumes section of docker-compose.yml
make clean

Show the logs for the running container

make log

Running the container also invokes [build]

make run

Interactively login to the container via a shell

  • NOTE: This step assumes the container is running.
make shell

Show status of the container

make status

Validation

About

A demo of doing some devopsy stuff in AWS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published