File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,6 +51,12 @@ func NewCompose(options ...Option) *Compose {
5151 ContainerName : fmt .Sprintf ("%s_redis" , dockerComposeContainerNamePrefix ),
5252 Expose : []string {"6397" },
5353 Image : "redis:7-alpine" ,
54+ Healthcheck : Healthcheck {
55+ Test : []string {"CMD" , "redis-cli" , "ping" },
56+ Interval : 5 * time .Second ,
57+ Timeout : 10 * time .Second ,
58+ Retries : 3 ,
59+ },
5460 },
5561 fmt .Sprintf ("%s_cockroachdb" , dockerComposeContainerNamePrefix ): {
5662 Command : "start-single-node --cluster-name=node --insecure" ,
@@ -153,6 +159,9 @@ func SetDependsOnCRDB() Option {
153159 fmt .Sprintf ("%s_cockroachdb" , dockerComposeContainerNamePrefix ): {
154160 Condition : "service_healthy" ,
155161 },
162+ fmt .Sprintf ("%s_redis" , dockerComposeContainerNamePrefix ): {
163+ Condition : "service_healthy" ,
164+ },
156165 }
157166 c .Services [k ] = v
158167 }
You can’t perform that action at this time.
0 commit comments