Dockerfile Deploys
Use a Dockerfile when you need full control.
When to use it
- Auto-detection picks the wrong stack.
- You need custom system packages.
- You run multiple build steps.
- Your app has a non-standard start command.
Requirements
Your container should:
- listen on the expected web port
- bind to
0.0.0.0 - keep the main process in the foreground
- write logs to stdout/stderr
Example
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
CMD ["npm", "start"]