I am attempting to get a Vue app running locally inside a Docker container and having an issue publishing to a specified port.
Here is my Dockerfile
FROM node:lts-alpine
RUN mkdir -p /app
COPY . /app
WORKDIR /app
RUN npm install
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]
In the root directory of my project I run
docker build --tag projectname .
This successfully creates an image which I should be able to run in a container.
However, whenever I run the following command I am unable to access the container from my browser at any port.
docker run -p 3000:3000 --name projectname projectname
The output shows some recommendations on splitting code to reduce size, but there are no errors, and it states that I should be able to access the app from http://localhost:8080, but that page provides a connection refused error.
I am under the impression that the publish option should listen on the exposed port 3000 and forward traffic to local port 3000.
However, this doesn't appear to be happening.
I am running Docker for Windows which might also be part of the problem.