No start command was found (dockerfile)
u007
FREEOP

8 months ago

im using Dockerfile,

why do i need the start command?

what should i set for start command?

Isnt the Dockerfile already have entrypoint ?

$10 Bounty

4 Replies

sim
FREE

8 months ago

Can you share your dockerfile?


sim
FREE

8 months ago

Railway should log "Using detected Dockerfile!" during deploy if it is reading from the dockerfile and the dockerfile needs to be in the root directory https://docs.railway.com/reference/dockerfiles


memphizzz
PRO

8 months ago

Does your Dockerfile have a line like:

ENTRYPOINT ["dotnet", "MyProject.dll"]

or

ENTRYPOINT ["npm", "start"]

? If not, you need to specify a "Custom Start Command" like "dotnet MyProject.dll" or "npm start" in the Railway UI.


u007
FREEOP

8 months ago

dockerfile:
```

FROM node:22-slim as base

RUN apt-get update && apt-get install -y curl unzip
RUN npm install -g pnpm
RUN curl -fsSL https://bun.sh/install | bash
# set path to bun
ENV HOME=/root
ENV PATH="${HOME}/.bun/bin:${PATH}"
RUN bun --version

WORKDIR /app

COPY backend/v2/ /app/backend/v2/
COPY shared/ /app/shared
RUN --mount=type=cache,id=pnpm,target=/bun cd /app/shared && bun install

RUN --mount=type=cache,id=pnpm,target=/bun cd /app/backend/v2 && bun install

# Generate Prisma client and build
RUN cd /app/backend/v2 && bunx prisma generate
RUN cd /app/backend/v2 && bun run build

WORKDIR /app/backend/v2

ENV NODE_ENV=production

EXPOSE 3000

# CMD ["bun", "run", "--sourcemap", "dist/index.js"]
ENTRYPOINT [ "bun", "run",  "--sourcemap", "dist/index.js"]

```


Loading...