----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
npx serverize
The npx serverize
command does the logic to configure, build, push and run your project. it execute series of prompts aka (wizard) to put the deployment steps in order.
That’s being said, there other ways in which you can deploy.
Specific framework
Serverize will try to understand the codebase and detect the framework you are using and try to set Dockerfile up, however you can make it more specific by using --framework
flag.
npx serverize -p <project-name> --framework <framework>
Using Local Dockerfile
In case you have Dockerfile and want to use it you can do so by executing the deploy command
npx serverize -p <project-name> --file ./Dockerfile
Using Git repository
Serverize also supports deploying from Git repostiry.
npx serverize -p <project-name> --file ./Dockerfile --context https://github.com/serverize/example-node.git#main:./
Tip
learn more about context inDocker context documentation
Using Docker image
You can also deploy docker image directly.
npx serverize deploy -p <project-name> --image <image-name>
Bear the following in mind:
- Make sure that you use fully qualified image name and that you’re authenticated to the image’s registry.
- The image should expose HTTP port otherwise 3000 is assumed.
- Image should exists locally.
docker pull <image-name>
- See deploy command for more information.
- Explore CI/CD Integration for automated deployments
- Learn about Releases for version management