-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-bake.hcl
More file actions
108 lines (93 loc) · 2.69 KB
/
docker-bake.hcl
File metadata and controls
108 lines (93 loc) · 2.69 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# docker-bake.hcl
# local override
# export REGISTRY=nmdra && docker buildx bake --print
# Define variables for customization
variable "REGISTRY" {
default = "ghcr.io/nmdra"
}
variable "TAG" {
default = "latest"
}
variable "STRIPE_SECRET_KEY" {}
variable "VITE_MAPBOX_API_KEY" {}
# Define common build configuration
target "common" {
args = {
BUILDKIT_INLINE_CACHE = "1"
}
labels = {
"org.opencontainers.image.vendor" = "CraveDrop"
"org.opencontainers.image.created" = "${timestamp()}"
"org.opencontainers.image.source" = "https://github.com/nmdra/cravedrop"
"org.opencontainers.image.authors" = "Nimendra"
"org.opencontainers.image.licenses" = "MIT"
}
}
# Default group builds all services with their specified targets from docker-compose
group "default" {
targets = ["frontend", "user-service", "notification-service", "email-service", "sms-service", "order-service", "payment-service", "driver-service", "delivery-service"]
}
# Frontend service
target "frontend" {
inherits = ["common"]
context = "./frontend"
tags = ["${REGISTRY}/frontend:${TAG}"]
args = {
STRIPE_SECRET_KEY = "${STRIPE_SECRET_KEY}"
VITE_MAPBOX_API_KEY = "${VITE_MAPBOX_API_KEY}"
}
}
# User Service (default to development as in docker-compose)
target "user-service" {
inherits = ["common"]
context = "./user-service"
target = "development"
tags = ["${REGISTRY}/user-service:${TAG}"]
}
# Notification Service (default to production as in docker-compose)
target "notification-service" {
inherits = ["common"]
context = "./notification-service"
target = "production"
tags = ["${REGISTRY}/notification-service:${TAG}"]
}
# Email Service (default to production as in docker-compose)
target "email-service" {
inherits = ["common"]
context = "./email-service"
target = "production"
tags = ["${REGISTRY}/email-service:${TAG}"]
}
# SMS Service (default to production as in docker-compose)
target "sms-service" {
inherits = ["common"]
context = "./sms-service"
target = "production"
tags = ["${REGISTRY}/sms-service:${TAG}"]
}
# Order Service
target "order-service" {
inherits = ["common"]
context = "./order-service"
target = "production"
tags = ["${REGISTRY}/order-service:${TAG}"]
}
# Payment Service
target "payment-service" {
inherits = ["common"]
context = "./payment-service"
target = "production"
tags = ["${REGISTRY}/payment-service:${TAG}"]
}
target "driver-service" {
inherits = ["common"]
context = "./driver-service"
target = "production"
tags = ["${REGISTRY}/driver-service:${TAG}"]
}
target "delivery-service" {
inherits = ["common"]
context = "./delivery-service"
target = "production"
tags = ["${REGISTRY}/delivery-service:${TAG}"]
}