Container failed to start issue
rogutkuba
HOBBYOP

2 years ago

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.

Solved

53 Replies

rogutkuba
HOBBYOP

2 years ago

404566f2-3f4d-4c60-af62-2478a44a8de6


2 years ago

please provide extra context about what you are trying to deploy and from where


rogutkuba
HOBBYOP

2 years ago

sure, trying to deploy hono js api package in my turbo monorepo


rogutkuba
HOBBYOP

2 years ago

from github


rogutkuba
HOBBYOP

2 years ago

  • using dockerfile


rogutkuba
HOBBYOP

2 years ago

please let me know if you need any more context


2 years ago

can you send the dockerfile?


rogutkuba
HOBBYOP

2 years 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 turbo@2.0.9 -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"]

2 years ago

looks alright, can you show the source of the service in the service settings


rogutkuba
HOBBYOP

2 years ago

is this what you are looking for?

1265518589352611800


2 years ago

yep


2 years ago

do you have a volume?


rogutkuba
HOBBYOP

2 years ago

no


2 years ago

how big is the built image?


rogutkuba
HOBBYOP

2 years ago

1.434 GB


2 years ago

does this dockerfile work locally?


rogutkuba
HOBBYOP

2 years ago

yeah and sorry the image is like ~2GB actually


rogutkuba
HOBBYOP

2 years ago

read wrong thing


2 years ago

~2gb is kinda big, can you throw in another repo as a test, one that doesn't result in a large image


rogutkuba
HOBBYOP

2 years ago

i used another repo of mine and it worked


rogutkuba
HOBBYOP

2 years ago

it crashed but it deployed fine


rogutkuba
HOBBYOP

2 years ago

so maybe I just need to reduce image size?


2 years ago

yes please attempt to get it below 1GB


rogutkuba
HOBBYOP

2 years ago

ok will try tomorrow and come back with my findings


2 years ago

sounds good!


rogutkuba
HOBBYOP

2 years ago

i got it down to 1.04GB and its still the same error


rogutkuba
HOBBYOP

2 years ago

like this is kinda ridiculous there is no error description at all and I literally upgraded from free trial yesterday


2 years ago

are you able to confirm that this works locally?


2 years ago

the Dockerfile that is


rogutkuba
HOBBYOP

2 years ago

yeah the image runs fine on my local machine


2 years ago

can you show me a screenshot of your service?


rogutkuba
HOBBYOP

2 years ago

1265705224576958700


rogutkuba
HOBBYOP

2 years ago

not sure exactly what you want me to ss


2 years ago

is this project id correct?


rogutkuba
HOBBYOP

2 years ago

yeah


rogutkuba
HOBBYOP

2 years ago

404566f2-3f4d-4c60-af62-2478a44a8de6


rogutkuba
HOBBYOP

2 years ago

its the same


2 years ago

how are you getting that project id?


rogutkuba
HOBBYOP

2 years ago

cmk k + copy project id


rogutkuba
HOBBYOP

2 years ago

1265705723048759600


rogutkuba
HOBBYOP

2 years ago

its the same thing in my project settings


2 years ago

@Ray - Container failed to start


2 years ago

!t


2 years ago

This thread has been escalated to the Railway team.

Status changed to Awaiting Railway Response brody over 1 year ago


rogutkuba
HOBBYOP

2 years ago

ok i just made a new project and it deployed fine wtf



2 years ago

could you please not touch the original project and service?


rogutkuba
HOBBYOP

2 years ago

sure thing ill keep it up 👍


2 years ago

thanks!


rogutkuba
HOBBYOP

2 years ago

it may just get redeployed to, is that fine?


2 years ago

yeah


2 years ago

Could you try switching the runtime in your service settings to "Legacy"?


Status changed to Awaiting User Response Railway over 1 year ago


2 years ago

^ ignore that, could you try removing the cd step from your start command? It shouldn't be needed


2 years ago

should likely just be pnpm start


Railway
BOT

2 years ago

This thread has been marked as solved automatically due to a lack of recent activity. Please open a new thread if you require further assistance. Thank you!

Status changed to Solved Railway over 1 year ago


Loading...