Deployment
Overview
SpeedPy is designed for Docker-based deployment. The recommended platform is Appliku, which deploys on your own servers for significant cost savings.
Docker
Dockerfile
SpeedPy uses a python:3.13.9-bookworm base image with Node.js 20 installed via NVM:
FROM python:3.13.9-bookworm
# Node.js installed via NVM
ENV NODE_VERSION=20.18.0
# Python dependencies
COPY requirements.txt /code/
RUN pip install -r requirements.txt
COPY . /code/
Docker Compose Services
| Service | Purpose |
|---|---|
web | Django dev server on port 9000 |
db | PostgreSQL database |
redis | Redis for Celery and caching |
celery | Celery worker |
celery-beat | Celery Beat scheduler (redbeat) |
media | Nginx for serving media files |
Running in Development
# Start all services
docker compose up -d
# Start just the web server
docker compose up -d web
# View logs
docker compose logs -f web
Gunicorn
For production, use Gunicorn instead of Django's development server. SpeedPy includes gunicorn in requirements.txt.
gunicorn project.wsgi:application --bind 0.0.0.0:8000
Release Script
The release.sh script runs during deployment to apply migrations and ensure a superuser exists:
#!/bin/bash
set -e
python manage.py migrate
python manage.py makesuperuser
This script is typically configured as a release command in your deployment platform.
Makefile Commands
The Makefile provides shortcuts for common operations:
| Command | Description |
|---|---|
make init | First-time project setup (build, migrate, create superuser) |
make dev | Start development server |
make mm | Make migrations |
make m | Run migrations |
make tw | Start Tailwind watch mode |
make twb | Build Tailwind CSS |
make bash | Open a bash shell in the container |
make run run=<cmd> | Run an arbitrary command in the container |
Appliku Deployment
Appliku is the recommended deployment platform. It handles:
- Docker-based deployments on your own servers
- Automatic SSL certificates
- Process management (web, worker, beat)
- Environment variable management
Follow Appliku's documentation to connect your repository and configure the deployment.
Production Checklist
Before deploying to production, ensure you:
- Set
DEBUG=False - Set a strong
SECRET_KEY - Set a unique
SALT_KEY - Configure
ALLOWED_HOSTS - Set up
DATABASE_URL(PostgreSQL) - Set up
REDIS_URL - Configure
EMAIL_URLwith a real email provider - Set
DEFAULT_FROM_EMAIL - Change
ADMIN_URLfrom the default - Set reCAPTCHA keys
- Run
collectstatic - Build Tailwind CSS