-
Notifications
You must be signed in to change notification settings - Fork 1
/
image.tf
35 lines (32 loc) · 1.72 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
# Code mostly taken from [3]
resource "docker_image" "saltandpaper" {
name = "${aws_ecr_repository.saltandpaper.repository_url}:latest"
build {
dockerfile = "./Dockerfile"
context = "."
build_arg = {
SQLALCHEMY_DATABASE_URI = "postgresql://${aws_db_instance.database.username}:${aws_db_instance.database.password}@${aws_db_instance.database.address}:${aws_db_instance.database.port}/${aws_db_instance.database.db_name}",
JSON_SORT_KEYS = "false",
CELERY_BROKER_URL = "sqs://",
CELERY_RESULT_BACKEND = "db+postgresql://${aws_db_instance.database.username}:${aws_db_instance.database.password}@${aws_db_instance.database.address}:${aws_db_instance.database.port}/${aws_db_instance.database.db_name}"
}
}
}
resource "docker_registry_image" "saltandpaper" {
name = docker_image.saltandpaper.name
}
resource "docker_image" "saltandpaper_worker" {
name = "${aws_ecr_repository.saltandpaper_worker.repository_url}:latest"
build {
dockerfile = "./Dockerfile.worker"
context = "."
build_arg = {
SQLALCHEMY_DATABASE_URI = "postgresql://${aws_db_instance.database.username}:${aws_db_instance.database.password}@${aws_db_instance.database.address}:${aws_db_instance.database.port}/${aws_db_instance.database.db_name}",
CELERY_BROKER_URL = "sqs://",
CELERY_RESULT_BACKEND = "db+postgresql://${aws_db_instance.database.username}:${aws_db_instance.database.password}@${aws_db_instance.database.address}:${aws_db_instance.database.port}/${aws_db_instance.database.db_name}"
}
}
}
resource "docker_registry_image" "saltandpaper_worker" {
name = docker_image.saltandpaper_worker.name
}