This guide will help you set up a local development environment for the Restarters.net project using Docker.
- Install prerequisites: Docker and Task
- Clone repository:
git clone https://github.com/TheRestartProject/restarters.net.git - Setup environment:
cp .env.docker .env - Start services:
task docker:up-core(ortask docker:up-allfor full environment) - Wait for setup:
task docker:wait-for-services-core - Access application: http://localhost:8001
Prerequisites and Windows Setup
Before you begin, ensure you have the following installed:
- Docker (newer versions already include Docker Compose)
- Docker Compose (only needed for older Docker versions)
- Task
If you're developing on Windows, then for acceptable performance you must:
- Make sure you have WSL2 installed. Running Docker under native windows via Docker Desktop is unusably slow.
- Check out the code to a WSL path (e.g.
/home/user/restarters.net). Do not use a path under/mnt. - Run the commands below from inside the WSL container.
- You must run the
file-sync.shjob to ensure changes are sync'd to the Docker containers.
Environment Profiles
The development environment includes several optional components:
- Core: Restarters web application and MySQL database
- Debug Tools: Adds phpMyAdmin and Mailhog for debugging and testing
- Discourse: Adds Discourse forum with its required services (PostgreSQL, Redis, Sidekiq)
- All: Starts all containers (Core, Debug Tools, Discourse)
# Start the core environment (app + database only)
task docker:up-core
# Start with debug tools (phpMyAdmin, Mailhog)
task docker:up-debug
# Start with Discourse integration
task docker:up-discourse
# Start all services
task docker:up-allDetailed Setup Steps
git clone https://github.com/TheRestartProject/restarters.net.git
cd restarters.netCopy the example environment file:
cp .env.docker .envYou may need to adjust the following settings in your .env file:
- The
APP_KEYwill be auto-generated during setup
[!NOTE] This is only required if the default port,
8001, is not available.
- Set
APP_URLto `http://localhost:PORT- You will need to change the port in the
docker-compose.ymlfile to match the port you are using.
- You will need to change the port in the
After starting services, you can wait for them to be fully ready and responding:
# Wait for core services to be ready
task docker:wait-for-services-core
# Wait for debug services to be ready
task docker:wait-for-services-debug
# Wait for Discourse services to be ready
task docker:wait-for-services-discourse
# Wait for all services to be ready
task docker:wait-for-services-allThe wait commands will check that services are listening on their expected ports and return proper responses.
The core application container will automatically:
- Install Composer dependencies
- Run database migrations
- Install npm packages
- Generate application key
- Create an admin user
You can monitor the progress by checking the container logs:
task docker:logsAccess Information
Once setup is complete:
- Main application: http://localhost:8001
- Admin:
jane@bloggs.net - Password:
passw0rd
- Admin:
- PHPMyAdmin: http://localhost:8002 (debug profile only)
- Host:
restarters_db - User:
root - Password:
s3cr3t
- Host:
- Mailhog: http://localhost:8026 (debug profile only)
- Discourse: http://localhost:8003 (discourse profile only)
- User:
someuser - Password:
mustbetencharacters
- User:
Testing
The project includes unified task commands that ensure consistent test execution between local development and CI environments:
# Run PHPUnit tests (includes coverage and CI integration)
task docker:test:phpunit
# Run Jest JavaScript tests
task docker:test:jest
# Run Playwright end-to-end tests
task docker:test:playwright
# Run Playwright autocomplete tests (requires special setup data)
task docker:test:playwright-autocompleteBefore running tests, you need to configure the Google API key for geocoding functionality:
-
Set Google API Key: Add a valid Google Maps API key to your
.envfile:GOOGLE_API_CONSOLE_KEY=your_actual_google_api_key_here
-
API Key Requirements: The key must have the following APIs enabled:
- Geocoding API
- Maps JavaScript API (for location validation)
[!WARNING] Without a valid
GOOGLE_API_CONSOLE_KEY, tests that create groups or events will fail with location validation errors.
[!NOTE] The PHPUnit task will automatically upload coverage to Coveralls if the
COVERALLS_REPO_TOKENenvironment variable is set.
Container Management Commands
# Open a shell in the container
task docker:shell
# Run a bash command
task docker:run:bash -- [command]
# Run an artisan command
task docker:run:artisan -- [command]# View container logs if services aren't starting properly
task docker:logs# Stop the core services
task docker:down-core
# Stop with the debug tools
task docker:down-debug
# Stop with Discourse
task docker:down-discourse
# Stop all containers
task docker:down-allIf you need to completely rebuild. This will remove all containers, volumes, networks, and images.
# Rebuild the core services
task docker:rebuild-core
# Rebuild with the debug tools
task docker:rebuild-debug
# Rebuild with Discourse
task docker:rebuild-discourse
# Rebuild all services
task docker:rebuild-allTroubleshooting
Services not starting properly
- Check logs:
task docker:logs - Ensure ports aren't in use by other applications
- Try rebuilding:
task docker:rebuild-core
Permission errors on Windows
- Add user to Docker group:
sudo usermod -aG docker $USER - Restart terminal/Docker Desktop
Database connection errors
- Wait for services:
task docker:wait-for-services-core - Check if MySQL container is running:
docker ps
Frontend assets not building
- Check if npm install completed in logs
- Manually run:
task docker:run:bash -- npm install
Slow Docker on Windows Follow the Docker performance optimization guide for significant improvements.
Build timeouts
- Increase Docker memory allocation in Docker Desktop settings
- Use
task docker:up-coreinstead oftask docker:up-allfor faster startup