I've got a node app that I can run locally using npm run. It is using express as the server and uses browser sync to show hot reloads.
Express is using port 6001
Browsersync is using ports 3000 and 3001
Docker file
FROM node/argon
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN npm install
ENV PATH /usr/src/app/node_modules/.bin:$PATH
USER app
COPY . /usr/src/app
RUN sudo chown -R app /usr/src/app
RUN npm start
EXPOSE 6001
CMD ["npm", "start"]
docker-compose.yml
web:
extends:
file: docker-compose-base.yml
service: web
ports:
- "6001:6001"
environment:
VIRTUAL_HOST: testing.docker
docker-compose-base.yml
web:
build: .
command: npm start
volumes:
- .:/usr/src/app
- /usr/src/app
- /usr/src/app/node_modules
I can run docker-compose build and it builds just fine, running docker-compose up spits out the following:
[BS] Access URLs:
----------------------------
Local: http://localhost:3000
----------------------------
UI: http://localhost:3001
----------------------------
Listening on http://localhost:6001
But accessing http://testing.docker appears as though the container never mounted. Running docker-compose ps shows no containers, but running docker ps shows the container is available.
I'm completely at a loss.
docker-compose upto start the containers?docker-compose up -dand thendocker-compose psin that directory, as well asdocker psto see if they return anything. Also trycurl localhost:6001to check if port mapping is correct.