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.
53 Replies
2 years ago
please provide extra context about what you are trying to deploy and from where
2 years ago
can you send the dockerfile?
# 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
2 years ago
yep
2 years ago
do you have a volume?
2 years ago
how big is the built image?
2 years ago
does this dockerfile work locally?
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
2 years ago
yes please attempt to get it below 1GB
2 years ago
sounds good!
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
2 years ago
can you show me a screenshot of your service?
2 years ago
is this project id correct?
2 years ago
how are you getting that project id?
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
2 years ago
could you please not touch the original project and service?
2 years ago
thanks!
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
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


