Docker container exits immediately with code 0

asked a month ago215 viewsen

1

My container runs and exits right away.

FROM node:20
COPY . .
RUN npm ci
CMD npm start

docker ps -a shows Exited (0). The app is a long-running server. What am I missing?

🤖 AI diagnosis

AI-generated. Not an answer — the community below confirms or corrects it. Always verify before relying on it.

asked a month ago

3 Answers

8

Lakehouse for the silver layer if you want Spark notebooks and Delta; Warehouse if your team is SQL-first. Pipelines orchestrate, notebooks transform. Keep bronze as raw files, silver as cleaned Delta tables, gold as a star schema.

Sign in to tell others whether this worked.

answered a month ago
7

Yes, use a bridge table. Create a distinct dimension with unique keys, relate both fact tables to it as many-to-one, and hide the raw many-to-many. DAX measures stay simple and USERELATIONSHIP becomes unnecessary.

Sign in to tell others whether this worked.

answered a month ago
6

Your CMD npm start runs in a shell that exits. Also you're missing EXPOSE and a proper working directory. Try:

WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
CMD ["node", "server.js"]

Exec form (["node", ...]) keeps the process as PID 1.

Sign in to tell others whether this worked.

answered a month ago

Sign in and verify your email to post an answer.