Prepare the application
Listen on0.0.0.0 and read the port from PORT. Add a lightweight endpoint that does not depend on slow external services.
Add a production Dockerfile
Pin a supported Node.js LTS version. Install dependencies in a build stage and run as a non-root user.CMD so Node receives signals directly. Do not put secrets in the image.
Deploy with Springwinter
1
Connect AWS and GitHub
Connect the AWS account that will own the infrastructure, then install the Springwinter GitHub App for the repository.
2
Create a web server
Open a project, click Add resource, and choose Web server.
3
Choose source and compute
Select the repository and branch. Choose CPU and memory based on measured load, not guesses.
4
Configure health and environment
Set the health path to
/healthz. Add NODE_ENV, application configuration, and service URLs as environment variables.5
Deploy and verify
Deploy, open the generated HTTPS URL, inspect CloudWatch-backed logs, and confirm CPU, memory, requests, and errors under Metrics.
Production checklist
- Commit lockfiles and use
npm cifor reproducible builds. - Keep request handlers stateless; place durable data in a database or S3.
- Send logs to stdout and stderr.
- Set explicit request, database, and outbound HTTP timeouts.
- Test shutdown during active traffic.
- Enable auto-deploy only on the branch that should reach production.
- Use previews for branch-level validation before merging.
Common deployment failures
A health check fails when the server binds only to localhost, listens on the wrong port, or performs expensive dependency checks. An out-of-memory restart usually means the selected memory is too small or the process has an unbounded cache. A deployment that never exits often runs through a shell wrapper that does not forwardSIGTERM.
Frequently asked questions
Does Springwinter require a Node.js buildpack?
Does Springwinter require a Node.js buildpack?
No. A Dockerfile gives you the clearest and most reproducible deployment. Springwinter builds the container from your GitHub source and runs the resulting image on ECS in your AWS account.
Where should Node.js secrets live?
Where should Node.js secrets live?
Configure secrets and service URLs as runtime environment variables. Never commit secrets to GitHub or copy them into a Docker image layer.
Can Springwinter deploy a Node.js monorepo?
Can Springwinter deploy a Node.js monorepo?
Yes, when the repository’s Dockerfile copies the correct workspace and produces one runnable image. Keep the Docker build context small and make the target service explicit.