aws / apprunner-roadmap

This is the public roadmap for AWS App Runner.
https://aws.amazon.com/apprunner/
Other
298 stars 14 forks source link

NodeJS express official tutorials don't work #210

Closed shide1989 closed 1 year ago

shide1989 commented 1 year ago

First of all, thanks for providing such a solution.

Unfortunately, after spending more 2 hours trying to deploy a simple ExpressJS Dockerised application, it just won't deploy.

I followed the tutorials from here https://docs.aws.amazon.com/apprunner/latest/dg/manage-create.html and even tried with the simplest code possible from https://www.apprunnerworkshop.com/getting-started/dockerfile/ but I kept on getting Failed service creations & deployments. I checked over and over the configurations from Docker / AWS / IAM roles etc. everything seem fine, but looks like AppRunner just won't work at all..

Btw: this is for a client, a on brand new AWS account.

A few logs :

08-28-2023 07:58:27 PM [AppRunner] Health check failed on port '3000'. Check your configured port number. For more information, read the application logs.
08-28-2023 07:52:22 PM [AppRunner] Performing health check on path '/' and port '3000'.
08-28-2023 07:52:12 PM [AppRunner] Provisioning instances and deploying image for publicly accessible service.
08-28-2023 07:52:01 PM [AppRunner] Successfully copied the image from ECR.
08-28-2023 07:50:56 PM [AppRunner] Successfully created pipeline for automatic deployments.

I will stop trying for now, and go to another service like Fargate.

shide1989 commented 1 year ago

BTW these are the only logs I get, I have no application logs at all. So my guess is that the container doesn't start at all. Even though I tried giving a start command such as the most basic node index.js.

here's the dockerfile :

FROM node:14

# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
COPY package*.json ./
RUN npm install
# Bundle app source
COPY . .
EXPOSE 3000
CMD [ "node", "index.js" ]

index.js :

const express = require('express');
const app = express();
const port = 3000;

app.get('/', (req, res) => {
    res.send('Hello World!');
});

app.listen(port, () => {
    console.log(`Example app listening at http://localhost:${port}`);
});
shide1989 commented 1 year ago

and region is in Ireland eu-west-1

shide1989 commented 1 year ago

It appears my client's account has been partially locked for some reason, which wasn't showed in the AppRunner console. I guess this is why nothing would deploy..