File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ const (
2424
2525type Input struct {
2626 Image string `toml:"image" validate:"required"`
27+ Port string `toml:"port"`
2728 Databases int `toml:"databases"`
2829 PullImage bool `toml:"pull_image"`
2930 Out * Output `toml:"out"`
@@ -95,12 +96,18 @@ func NewPostgreSQL(in *Input) (*Output, error) {
9596 WithStartupTimeout (20 * time .Second ).
9697 WithPollInterval (1 * time .Second ),
9798 }
99+ var port string
100+ if in .Port != "" {
101+ port = in .Port
102+ } else {
103+ port = ExposedStaticPort
104+ }
98105 req .HostConfigModifier = func (h * container.HostConfig ) {
99106 h .PortBindings = nat.PortMap {
100107 nat .Port (bindPort ): []nat.PortBinding {
101108 {
102109 HostIP : "0.0.0.0" ,
103- HostPort : fmt .Sprintf ("%s/tcp" , ExposedStaticPort ),
110+ HostPort : fmt .Sprintf ("%s/tcp" , port ),
104111 },
105112 },
106113 }
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ func TestDockerNodeSetSharedDB(t *testing.T) {
8787 DataProviderURL : "http://example.com" ,
8888 DbInput : & postgres.Input {
8989 Image : "postgres:15.6" ,
90+ Port : "14000" ,
9091 },
9192 Node : & clnode.NodeInput {
9293 Image : "public.ecr.aws/chainlink/chainlink:v2.17.0" ,
You can’t perform that action at this time.
0 commit comments