Configuring Build and Start Commands
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
Section titled “Framework Examples”Here are some common examples for different frameworks.
Build Command
npm install
Start Command
node server.js
Build Command
pip install -r requirements.txt
Start Command
uvicorn main:app --host 0.0.0.0 --port 8000
Build Command
pip install -r requirements.txt
Start Command
gunicorn my-project.wsgi --bind 0.0.0.0:8000
Build Command
go build -o app .
Start Command
./app
Advanced Usage
Section titled “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
Section titled “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.sh
startup.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.sh
Then, set your start command to:
Terminal ./startup.sh