mirror of
https://github.com/MichaelCade/90DaysOfDevOps.git
synced 2025-01-09 06:36:39 +07:00
24 lines
387 B
Terraform
24 lines
387 B
Terraform
|
terraform {
|
||
|
required_providers {
|
||
|
docker = {
|
||
|
source = "kreuzwerker/docker"
|
||
|
version = "2.16.0"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
provider "docker" {}
|
||
|
|
||
|
resource "docker_image" "nginx" {
|
||
|
name = "nginx:latest"
|
||
|
keep_locally = false
|
||
|
}
|
||
|
|
||
|
resource "docker_container" "nginx" {
|
||
|
image = docker_image.nginx.latest
|
||
|
name = "tutorial"
|
||
|
ports {
|
||
|
internal = 80
|
||
|
external = 8000
|
||
|
}
|
||
|
}
|