Configuring Build and Start Commands
Learn how to configure build and start commands for your applications on **seenode** to ensure proper deployment and execution.
The build command and start command are essential for preparing and running your application on seenode.
- The build command installs dependencies and compiles or prepares your application for execution.
- The start command starts your application, making it available for requests.
seenode attempts to automatically detect these commands, but you can customize them based on your project’s needs.
Framework Examples
Here are some common examples for different frameworks.
Build Command
npm installStart Command
node server.jsBuild Command
pip install -r requirements.txtStart Command
uvicorn main:app --host 0.0.0.0 --port 8000Build Command
pip install -r requirements.txtStart Command
gunicorn my-project.wsgi --bind 0.0.0.0:8000Tip
For production, it is recommended to use a production-ready web server like Gunicorn instead of Django’s runserver.
Build Command
go build -o app .Start Command
./app::::note
Use the Port input during service setup to tell seenode where your application listens. Bind your start command to the same port on 0.0.0.0 (for example, --port 8000). Avoid relying on a PORT environment variable.
::::
Advanced Usage
Sometimes, you need to run additional commands as part of your build or start process. You can chain commands using &&.
Running Database Migrations
It’s a common practice to run database migrations before starting the application.
-
Chain the commands
You can add the migration command to your start command, separated by
&&.Django Example
Terminal python manage.py migrate && gunicorn my-project.wsgi --bind 0.0.0.0:8000FastAPI with Alembic Example
Terminal alembic upgrade head && uvicorn main:app --host 0.0.0.0 --port 8000 -
Use a startup script
For more complex startup sequences, you can create a script.
startup.shstartup.sh #!/bin/sh# Run migrationspython manage.py migrate# Start the applicationgunicorn my-project.wsgi --bind 0.0.0.0:8000Make the script executable:
chmod +x startup.shThen, set your start command to:
Terminal ./startup.sh