Docker Container Not Showing Up

Viewed 386

I am following along with this tutorial to learn how to containerize a node.js / express application I'm working on. Everything seems to be working fine, except that when I docker ps after building the container, I don't see my running container.

Node.js / express code:

const express = require("express");

const app = express();

const port = process.env.PORT || 3000;

app.get('/', (req, res) => {
    res.send("Hi there")
})

app.listen(port, () => console.log("Listening On Port 3000"))

Dockerfile

FROM node:latest
WORKDIR /untitled
COPY package.json .
RUN npm install
EXPOSE 3000
COPY . ./
CMD node server.js

My working directory is "untitled" because that's the default name that Webstorm gives my project and I haven't changed it yet.

The image build seems to have worked fine

enter image description here

As well as the container build

enter image description here

But docker ps isn't showing me any containers

enter image description here

0 Answers
Related