diff --git a/Dockerfile b/Dockerfile index 81ca439..800a723 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM nginx:alpine +FROM nginx:1.25-alpine -COPY default.conf /etc/nginx/conf.d/default.conf +ENV NGINX_PORT=80 + +COPY default.conf.template /etc/nginx/templates/default.conf.template COPY *.html /etc/nginx/html/ diff --git a/README.md b/README.md index 6f5c808..d2a3aa9 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,14 @@ -ECS Placeholder -=============== +# ECS Placeholder The purpose of this project is to provide a placeholder image with a `/health` HTTP endpoint for use with AWS ECS and Terraform. Since Terraform is primarily an infrastructure management tool and not an application deployment tool, coupling ECS metadata such as task definition files to Terraform makes for complex deployment scenarios. Often times we just want to have Terraform -create the service and deploy new ECS task definition versions independently. Since ECS requires *some* kind of image to be +create the service and deploy new ECS task definition versions independently. Since ECS requires _some_ kind of image to be referenced, this is where this image comes in. + +## Configuration + +| Environment Variable | Description | Default | +| -------------------- | ------------------------------------------------------------- | ------- | +| `NGINX_PORT` | Controls the port on which the server listens for requests on | `80` | diff --git a/default.conf b/default.conf.template similarity index 87% rename from default.conf rename to default.conf.template index 7badcc9..7478216 100644 --- a/default.conf +++ b/default.conf.template @@ -1,5 +1,5 @@ server { - listen 80; + listen ${NGINX_PORT}; location / { try_files /index.html /index.html;