Answer the question
In order to leave comments, you need to log in
How to forward a port from a container to the Internet?
I have a DO server with a standard docker droplet, and a dockerfile:
FROM node:carbon
WORKDIR /var/www/node_cz
RUN npm i --global @adonisjs/cli
EXPOSE 3000
docker run -v /var/www/node_cz:/var/www/node_cz --name node -p 80:3000 -it whata/node-node /bin/bash
Answer the question
In order to leave comments, you need to log in
Everything turned out to be simple, it was necessary to run the app inside the container at 0.0.0.0:3000 , instead of 127.0.0.1:3000 .
docker run -v /var/www/node_cz:/var/www/node_cz --name node -p 80:3000 -it whata/node-node /bin/bash
With this command you go inside the container. To run it in the background, you need to specify the detached flag , i.e. try like this:Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question