-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathimage.tf
44 lines (36 loc) · 1.23 KB
/
image.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Build and push the server image to ECR
resource "aws_ecr_repository" "coverlettergen_server" {
name = "coverlettergen_server"
}
resource "docker_image" "coverlettergen_server" {
name = "${aws_ecr_repository.coverlettergen_server.repository_url}:latest"
build {
context = "."
dockerfile = "Dockerfile.server"
}
}
resource "docker_registry_image" "coverlettergen_server" {
name = docker_image.coverlettergen_server.name
}
output "ecr_repository_url_server" {
value = aws_ecr_repository.coverlettergen_server.repository_url
}
#------------------------------------------------------------
# Build and push the worker image to ECR (with different build arguements)
resource "aws_ecr_repository" "coverlettergen_worker" {
name = "coverlettergen_worker"
}
resource "docker_image" "coverlettergen_worker" {
name = "${aws_ecr_repository.coverlettergen_worker.repository_url}:latest"
build {
context = "."
dockerfile = "Dockerfile.worker"
}
}
resource "docker_registry_image" "coverlettergen_worker" {
name = docker_image.coverlettergen_worker.name
}
output "ecr_repository_url_worker" {
value = aws_ecr_repository.coverlettergen_worker.repository_url
}
#------------------------------------------------------------