I'm having trouble making HTTP requests to my docker container (it's a Node.js API that communicates with a Redis database), which runs inside a VM (Docker Toolbox).
I've set up my Dockerfile and docker-compose.yml with the desired ports. Built them and ran ("up") them successfully.
FROM node:8.15
WORKDIR /redis_server
COPY package.json package-lock.json ./
RUN npm install
COPY . ./
EXPOSE 8080
CMD ["npm", "start"]
version: '3'
services:
web:
build: .
depends_on:
- db
db:
image: redis
ports:
- "6379:6379"
redis.js
const PORT = 6379
const HOST = 'db'
server.js (express.js)
const PORT = '0.0.0.0:8080'
I build the container succesfully, then use a HTTP request service to test a GET. Since I run Docker Toolbox and that the VM is on host 192.168.99.100, I send my requests to http://192.168.99.100:8080.
This does not work, the error message that appears in my Visual Studio Code is "Connection is being rejected. The service isn't running on the server, or incorrecte proxy settings in vscode, or a firewall is blocking requests. Details: Error: connect ECONNREFUSED 192.168.99.100:8080."
Not sure where to go from here. I don't consider myself knowledgeable on things network.