A simple Terraform project that deploys two Docker containers: an NGINX SSL proxy and a "Hello World" application.
- Creates an NGINX container with SSL configuration
- Creates an application container that responds with "Hello World"
- Sets up automatic DNS routing via hosts file
- Establishes secure communication between containers
.
├── main.tf # Main Terraform configuration
├── install.sh # Dependencies installation script
├── nginx/
│ └── nginx.conf # NGINX SSL and proxy configuration
└── ssl/ # SSL certificates (generated during install)
- Install dependencies:
sudo ./install.sh
- Deploy containers:
terraform init
terraform apply
- Access the application:
# Add to /etc/hosts:
sudo sh -c "echo '127.0.0.1 example.local' >> /etc/hosts"
# Then visit:
https://example.local
- Cleanup:
terraform destroy
- Project configuration: See comments in
main.tf
- SSL configuration: See
nginx/nginx.conf
- Installation details: See
install.sh