I have a node app using express, and am trying to deploy using heroku.
import http from 'http';
import express from 'express';
import pagesRouter from './routes/pages';
import nconf from 'nconf';
const app = express();
app.use(pagesRouter);
const port = process.env.PORT || nconf.get('port');
server = http.createServer(app);
server.listen(port);
And this works fine locally to create the server, and serve all the routes I've created.
I've then tried to dockerize this to deploy to heroku by creating a dockerfile, and heroku.yml for this:
FROM node:18.12.1
WORKDIR ./
COPY . .
ENV NODE_ENV production
RUN npm ci
RUN npm run build
RUN npm prune --production
EXPOSE 6001
CMD ["npm", "run", "start"]
build:
docker:
web: Dockerfile
Looking in the logs of heroku, I can see this is running and starting correctly, however when I try to click on 'open app' to view the app running at https://www.damp-garden-69923.herokuapp.com/
I get the following error:
This site can’t be reached
www.damp-garden-69923.herokuapp.com’s server IP address could not be found.
ERR_NAME_NOT_RESOLVED
I'm not sure if I'm missing something, but would appreciate any help
Note: I am using the GUI rather than heroku CLI