I’m writing a Java app that needs to connect to a database backend. The connection is handled by the database SDK (Couchbase in this case), which starts up a replicator to a specific endpoint (wss://). When running this app from the IDE or by running the executable from the command line, everything works fine. However, when I build the Docker image, and then run the image in a container, the web socket connection fails to connect. From the log output, I can see that it gets stuck on “connecting”:
ReplicatorChange{replicator=Replicator{@450b4ee,<-,Database{@247240e5, name='<redacted>'},URLEndpoint{url=wss://<redacted>:443/data}], status=Status{activityLevel=CONNECTING, progress=Progress{completed=0, total=0}, error=null}}
Once the app reaches the above line, it gets stuck there and nothing happens. And it’s not a network issue, because HTTP connections work fine, since prior to this, the app creates a session by calling an HTTP endpoint.
I’m fairly new to Docker, so is there anything in the container that is preventing the replicator from connecting? I’ve looked into EXPOSE in the Docker file, and running with -p or -P, but none have worked so far.