Docker Dev environment -- can't connect to websocket

Hey everyone. I’ve been trying for the past couple of days to set up a Docker dev environment with Meteor and I’m running into a problem. I just can’t seem to get websockets to connect. Everything else works fine, it’s just websockets that won’t connect.

Here are my two questions:

  1. Is there a good way to debug my app to make sure it’s not something in my own code that’s causing this?

  2. Is there something wrong with my Dockerfile that could be causing this? Here’s the Dockerfile:

FROM node:12.19.0-buster

ENV METEOR_ALLOW_SUPERUSER=true
ENV ROOT_URL="http://127.0.0.1:3000"
ENV PORT 3000


RUN curl "https://install.meteor.com/" | sh

COPY . /usr/src/app
WORKDIR /usr/src/app

RUN npm install
RUN meteor npm install

EXPOSE 3000

I’m also using the VS Code Remote Containers extension to develop in the container. I’m sure there’s another way to do it, but I’m totally new to Docker and Meteor, so I’m not really sure what best practices are and there’s just sooooo much conflicting information out there that I’m having a little trouble figuring out how to really get going.

Thanks in advance!

For anyone who’s looking for a solution to this problem in the future, all you have to do is set `ENV DDP_DEFAULT_CONNECTION_URL=“http://127.0.0.1:3000” with the other environment variables in the Dockerfile.

Here’s the updated file:

FROM node:12.19.0-buster

ENV METEOR_ALLOW_SUPERUSER=true
ENV ROOT_URL="http://0.0.0.0:3000"
ENV DDP_DEFAULT_CONNECTION_URL="http://127.0.0.1:3000"
ENV PORT 3000


RUN curl "https://install.meteor.com/" | sh

COPY . /usr/src/app
WORKDIR /usr/src/app

RUN npm install
RUN meteor npm install

EXPOSE 3000