This project contains the build system for Albumentations documentation and website. It uses Docker and Make to create a consistent build environment and streamline the development process.
- Docker
- Docker Compose
- Make
- Git
Create a .env
file with the following variables:
GOOGLE_ANALYTICS_ID=your_ga_id
GITHUB_TOKEN=your_github_token
MKDOCS_PORT=8000 # Optional, defaults to 8000
NODE_ENV=development # Or 'production' for builds
.
├── docs/ # Documentation source
│ ├── src/ # MkDocs source files
│ ├── scripts/ # Build and utility scripts
│ └── Dockerfile # Docs container definition
├── website/ # Website source
│ └── Dockerfile # Website container definition
├── docker-compose.yml # Container orchestration
└── Makefile # Build automation
- Set up environment variables:
cp .env.example .env
Edit .env with your credentials
- Start development server:
make docs-dev
The documentation will be available at http://localhost:8000
make docs-dev
- Start documentation server in development modemake dev
- Start both website and docs in development modemake setup
- Set up development environmentmake download-notebooks
- Download and convert example notebooksmake build-local
- Build documentation locally
make prod
- Build both website and docs for productionmake build-docs
- Build only documentationmake build-website
- Build only websitemake build-all
- Build everything
make clean
- Clean all build artifactsmake logs
- Show container logsmake ps
- List running containersmake restart
- Restart containersmake stop
- Stop containers
- Base image: Python 3.12
- Exposed port: 8000
- Volumes:
- Development:
./docs:/workspace/docs
- Cache:
docs_cache:/workspace/docs/src/.cache
- Development:
WORKSPACE_DIR=/workspace
DOCS_DIR=/workspace/docs
ALBUMENTATIONS_DIR=/workspace/albumentations
JUPYTER_PLATFORM_DIRS=1
GOOGLE_ANALYTICS_ID
(from .env)
To create a production build:
- Ensure environment variables are set
export NODE_ENV=production
export GOOGLE_ANALYTICS_ID=your_ga_id
export GITHUB_TOKEN=your_github_token
- Run production build:
make prod
Build artifacts will be in:
- Website:
_build/
- Documentation:
_build/docs/
- The development server supports hot reloading
- Notebook conversion is done in parallel for better performance
- Cache is preserved between builds in a Docker volume
- Health checks are configured for the documentation server
- If builds fail, try cleaning first:
make clean
make build-all
- For permission issues:
sudo chown -R $(id -u):$(id -g) build/
- To reset the environment:
docker-compose down -v
make clean
make setup