Container failed to start issue

Every time I try to deploy an application, I run into an issue where the platform gives me the error "Container failed to start" and "Failed to start deployment." without anymore details.
41 Replies
Percy
Percy5mo ago
Project ID: 404566f2-3f4d-4c60-af62-2478a44a8de6
Brody
Brody5mo ago
please provide extra context about what you are trying to deploy and from where
King Kazu
King KazuOP5mo ago
sure, trying to deploy hono js api package in my turbo monorepo from github + using dockerfile please let me know if you need any more context
Brody
Brody5mo ago
can you send the dockerfile?
King Kazu
King KazuOP5mo ago
# Base stage with node:20-slim and pnpm setup
FROM node:20-slim AS base

# Environment variables for pnpm
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

# Enable corepack to use pnpm
RUN corepack enable

# Install necessary build tools
RUN apt-get update && apt-get install -y \
build-essential \
python3 \
&& rm -rf /var/lib/apt/lists/*

# Builder stage
FROM base AS builder
WORKDIR /usr/src/app

# Copy root package.json and lockfile
COPY package.json .
COPY pnpm-lock.yaml .

# Copy the rest of the application
COPY . .
RUN pnpm install [email protected] -g
RUN turbo prune @monetize/api --docker

# Install dependencies
RUN pnpm install

# install dependencies in the apps/api folder
RUN pnpm install --prefix ./apps/api

# Expose port 3000
EXPOSE 3000

# Command to run the application
CMD ["node", "./apps/api/dist/server.js"]
# Base stage with node:20-slim and pnpm setup
FROM node:20-slim AS base

# Environment variables for pnpm
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

# Enable corepack to use pnpm
RUN corepack enable

# Install necessary build tools
RUN apt-get update && apt-get install -y \
build-essential \
python3 \
&& rm -rf /var/lib/apt/lists/*

# Builder stage
FROM base AS builder
WORKDIR /usr/src/app

# Copy root package.json and lockfile
COPY package.json .
COPY pnpm-lock.yaml .

# Copy the rest of the application
COPY . .
RUN pnpm install [email protected] -g
RUN turbo prune @monetize/api --docker

# Install dependencies
RUN pnpm install

# install dependencies in the apps/api folder
RUN pnpm install --prefix ./apps/api

# Expose port 3000
EXPOSE 3000

# Command to run the application
CMD ["node", "./apps/api/dist/server.js"]
Brody
Brody5mo ago
looks alright, can you show the source of the service in the service settings
King Kazu
King KazuOP5mo ago
is this what you are looking for?
No description
Brody
Brody5mo ago
yep do you have a volume?
King Kazu
King KazuOP5mo ago
no
Brody
Brody5mo ago
how big is the built image?
King Kazu
King KazuOP5mo ago
1.434 GB
Brody
Brody5mo ago
does this dockerfile work locally?
King Kazu
King KazuOP5mo ago
yeah and sorry the image is like ~2GB actually read wrong thing
Brody
Brody5mo ago
~2gb is kinda big, can you throw in another repo as a test, one that doesn't result in a large image
King Kazu
King KazuOP5mo ago
i used another repo of mine and it worked it crashed but it deployed fine so maybe I just need to reduce image size?
Brody
Brody5mo ago
yes please attempt to get it below 1GB
King Kazu
King KazuOP5mo ago
ok will try tomorrow and come back with my findings
Brody
Brody5mo ago
sounds good!
King Kazu
King KazuOP4mo ago
i got it down to 1.04GB and its still the same error like this is kinda ridiculous there is no error description at all and I literally upgraded from free trial yesterday
Brody
Brody4mo ago
are you able to confirm that this works locally? the Dockerfile that is
King Kazu
King KazuOP4mo ago
yeah the image runs fine on my local machine
Brody
Brody4mo ago
can you show me a screenshot of your service?
King Kazu
King KazuOP4mo ago
No description
King Kazu
King KazuOP4mo ago
not sure exactly what you want me to ss
Brody
Brody4mo ago
is this project id correct?
King Kazu
King KazuOP4mo ago
yeah 404566f2-3f4d-4c60-af62-2478a44a8de6 its the same
Brody
Brody4mo ago
how are you getting that project id?
King Kazu
King KazuOP4mo ago
cmk k + copy project id
King Kazu
King KazuOP4mo ago
No description
King Kazu
King KazuOP4mo ago
its the same thing in my project settings
Brody
Brody4mo ago
@Ray - Container failed to start !t
Duchess
Duchess4mo ago
New reply sent from Help Station thread:
This thread has been escalated to the Railway team.
You're seeing this because this thread has been automatically linked to the Help Station thread.
King Kazu
King KazuOP4mo ago
ok i just made a new project and it deployed fine wtf
Brody
Brody4mo ago
could you please not touch the original project and service?
King Kazu
King KazuOP4mo ago
sure thing ill keep it up 👍
Brody
Brody4mo ago
thanks!
King Kazu
King KazuOP4mo ago
it may just get redeployed to, is that fine?
Brody
Brody4mo ago
yeah
Duchess
Duchess4mo ago
New reply sent from Help Station thread:
Could you try switching the runtime in your service settings to "Legacy"?
You're seeing this because this thread has been automatically linked to the Help Station thread.
Ray
Ray4mo ago
^ ignore that, could you try removing the cd step from your start command? It shouldn't be needed should likely just be pnpm start
Want results from more Discord servers?
Add your server