Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
214 commits
Select commit Hold shift + click to select a range
b7a810f
WIP Change CircleCI to use Docker Compose.
edwh Jun 23, 2025
fc72393
WIP Change CircleCI to use Docker Compose.
edwh Jun 23, 2025
45e3b7d
WIP Change CircleCI to use Docker Compose.
edwh Jun 23, 2025
650691a
WIP Change CircleCI to use Docker Compose.
edwh Jun 23, 2025
d5b4cbc
WIP Change CircleCI to use Docker Compose.
edwh Jun 23, 2025
62b4404
WIP Change CircleCI to use Docker Compose.
edwh Jun 23, 2025
a35e09f
WIP Change CircleCI to use Docker Compose.
edwh Jun 23, 2025
f3629b8
WIP Change CircleCI to use Docker Compose.
edwh Jun 23, 2025
baa2b14
WIP Change CircleCI to use Docker Compose.
edwh Jun 23, 2025
5818a40
WIP Change CircleCI to use Docker Compose.
edwh Jun 23, 2025
e1dcf20
WIP Change CircleCI to use Docker Compose.
edwh Jun 23, 2025
b3ced01
We are using MySQL 8, so up the Docker Compose version. Also update …
edwh Jul 8, 2025
6b40f1f
Fail Docker startup on error.
edwh Jul 8, 2025
a3b6462
Migration creates TRIGGERs which are no longer used and require permi…
edwh Jul 8, 2025
34f58f4
Phpunit tests failing.
edwh Jul 8, 2025
5b76d7b
pcntl_signal not found.
edwh Jul 8, 2025
6df44bf
Handle test user already existing.
edwh Jul 8, 2025
1cf62fc
Phpunit tests failing.
edwh Jul 8, 2025
3136622
Phpunit tests failing.
edwh Jul 8, 2025
0e49551
Make docker_run wait for DB to be available before proceeding.
edwh Jul 8, 2025
0277f5e
Make docker_run wait for DB to be available before proceeding.
edwh Jul 8, 2025
bcad74f
Make docker_run wait for DB to be available before proceeding.
edwh Jul 8, 2025
865054f
Make docker_run wait for DB to be available before proceeding.
edwh Jul 8, 2025
7e8e1c4
Make docker_run wait for DB to be available before proceeding.
edwh Jul 8, 2025
4ed2803
Make docker_run wait for DB to be available before proceeding.
edwh Jul 8, 2025
07b8d46
PHPUnit test fails.
edwh Jul 8, 2025
9595dd0
Adopt short array syntax
laravel-shift Apr 19, 2025
de56b3d
Slim `lang` files
laravel-shift Apr 19, 2025
5c14480
Remove explicit call to register policies
laravel-shift Apr 19, 2025
e3e1a77
Shift core files
laravel-shift Apr 19, 2025
9e0b1c2
Shift config files
laravel-shift Apr 19, 2025
b54617e
Default config files
laravel-shift Apr 19, 2025
1063d6a
Bump Composer dependencies
laravel-shift Apr 19, 2025
1846cab
Bump NPM dependencies
laravel-shift Apr 19, 2025
2138636
Adopt anonymous migrations
laravel-shift Apr 19, 2025
9c801af
Rename `password_resets` table
laravel-shift Apr 19, 2025
5ad613d
Add type hints for Laravel 10
laravel-shift Apr 19, 2025
4fabcc6
Add type hints from DocBlocks
laravel-shift Apr 19, 2025
22f61fe
Remove redundant typing from DocBlocks
laravel-shift Apr 19, 2025
2b34914
fix: drop DB::raw calls
ardelato Apr 21, 2025
33d9ade
refactor(validation): update Timezone rule to use ValidationRule cont…
ardelato Apr 21, 2025
f9e3d5f
fix: actually return arrays for event classes
ardelato Apr 21, 2025
0c8d1e7
PHPUnit test fails.
edwh Jul 14, 2025
549f769
PHPUnit test fails.
edwh Jul 14, 2025
3a0eb95
Use --teamcity on phpunit to make it easier to spot failing tests on …
edwh Jul 14, 2025
84d625b
Exclude NotificationsTest which is failing with a facade error which …
edwh Jul 14, 2025
f45f2ac
Possible fix for MenusTest.
edwh Jul 14, 2025
bdbc4d2
Possible fix for NotificationsTest.
edwh Jul 21, 2025
63650e2
WIP Change CircleCI to use Docker Compose.
edwh Jul 21, 2025
a647963
WIP Change CircleCI to use Docker Compose.
edwh Jul 21, 2025
b6787e4
WIP Change CircleCI to use Docker Compose.
edwh Jul 21, 2025
47841d2
WIP Change CircleCI to use Docker Compose.
edwh Jul 21, 2025
6491750
WIP Change CircleCI to use Docker Compose.
edwh Jul 21, 2025
8a59106
WIP Change CircleCI to use Docker Compose.
edwh Jul 21, 2025
fe86bf0
WIP Change CircleCI to use Docker Compose.
edwh Jul 21, 2025
c607c94
WIP Change CircleCI to use Docker Compose.
edwh Jul 21, 2025
17b35d2
WIP Change CircleCI to use Docker Compose.
edwh Jul 21, 2025
929bb56
WIP Change CircleCI to use Docker Compose.
edwh Jul 21, 2025
a99c4ce
WIP Change CircleCI to use Docker Compose.
edwh Jul 21, 2025
0eaac9c
WIP Change CircleCI to use Docker Compose.
edwh Jul 21, 2025
4200338
WIP Change CircleCI to use Docker Compose.
edwh Jul 21, 2025
5e12183
WIP Change CircleCI to use Docker Compose.
edwh Jul 22, 2025
77b85d1
WIP Change CircleCI to use Docker Compose.
edwh Jul 28, 2025
dc36058
WIP Change CircleCI to use Docker Compose.
edwh Jul 28, 2025
fb87c63
WIP Change CircleCI to use Docker Compose.
edwh Jul 28, 2025
2ebc05c
WIP Change CircleCI to use Docker Compose.
edwh Jul 28, 2025
768af48
WIP Change CircleCI to use Docker Compose.
edwh Jul 28, 2025
eac2dcc
WIP Change CircleCI to use Docker Compose.
edwh Jul 28, 2025
e160612
WIP Change CircleCI to use Docker Compose.
edwh Jul 28, 2025
74d3892
WIP Change CircleCI to use Docker Compose.
edwh Jul 28, 2025
7cd0678
WIP Change CircleCI to use Docker Compose.
edwh Jul 28, 2025
61879fc
WIP Change CircleCI to use Docker Compose.
edwh Jul 28, 2025
28adb19
WIP Change CircleCI to use Docker Compose.
edwh Jul 28, 2025
43f93db
WIP Change CircleCI to use Docker Compose.
edwh Jul 28, 2025
3325d09
WIP Change CircleCI to use Docker Compose.
edwh Jul 31, 2025
087b1ce
WIP Change CircleCI to use Docker Compose.
edwh Aug 1, 2025
9d342b3
WIP Change CircleCI to use Docker Compose.
edwh Aug 1, 2025
fdb5c6c
WIP Change CircleCI to use Docker Compose.
edwh Aug 1, 2025
1a4b573
WIP Change CircleCI to use Docker Compose.
edwh Aug 1, 2025
f58a84f
WIP Change CircleCI to use Docker Compose.
edwh Aug 1, 2025
4569846
WIP Change CircleCI to use Docker Compose.
edwh Aug 1, 2025
6849be5
Bitnami mediawiki image is now archived.
edwh Aug 11, 2025
bde5c2a
Upgrade packages
edwh Aug 11, 2025
7420a32
Sort out composer compatibility by using forked and fixed packages. …
edwh Aug 11, 2025
46ce91a
Page loads with no JS errors
edwh Aug 11, 2025
a3ad9d8
Login page loads, but still some JS issues
edwh Aug 11, 2025
b0032b6
Merge branch 'develop' into upgrade-laravel-10x-restart
edwh Aug 18, 2025
79a1aeb
Composer packages/
edwh Sep 1, 2025
5fe779a
CircleCI docker image.
edwh Sep 1, 2025
4001141
PHP version 8.2 required.
edwh Sep 1, 2025
27e4404
PHP version 8.2 required.
edwh Sep 1, 2025
e585b11
PHP version 8.2 required.
edwh Sep 1, 2025
4ac57c5
xmlrpc not installed in CircleCI.
edwh Sep 1, 2025
3c4d9e5
xmlrpc not installed in CircleCI.
edwh Sep 1, 2025
3f95779
Use our fork of laravel-drip
edwh Sep 1, 2025
84236fd
phpunit fixes
edwh Sep 1, 2025
da442a8
CircleCI needs to build using vite.
edwh Sep 1, 2025
21e1fa1
CircleCI lock mediawiki version
edwh Sep 1, 2025
cbbc5ba
Merge branch 'refs/heads/develop' into RES-2026_circleci_docker_compose
edwh Sep 17, 2025
be0ea8d
Bitnami has archived images.
edwh Sep 17, 2025
ceb51a1
Merge branch 'refs/heads/RES-2026_circleci_docker_compose' into upgra…
edwh Sep 17, 2025
cdee4d4
Getting Laravel 10 working on CircleCI.
edwh Sep 17, 2025
f6aa610
Getting Laravel 10 working on CircleCI.
edwh Sep 17, 2025
c01e4fa
CRLF, SQL error
edwh Sep 17, 2025
7021989
Switching Windows docker dev to run under WSL.
edwh Sep 17, 2025
86b237b
Getting Laravel 10 working on CircleCI.
edwh Sep 17, 2025
101ad6c
Getting Laravel 10 working on CircleCI.
edwh Sep 17, 2025
b12a671
Getting Laravel 10 working on CircleCI.
edwh Sep 17, 2025
98e78d6
Getting Laravel 10 working on CircleCI.
edwh Sep 17, 2025
e65b22e
Getting Laravel 10 working on CircleCI.
edwh Sep 17, 2025
d5757b9
Getting Laravel 10 working on CircleCI.
edwh Sep 24, 2025
33600d6
Getting Laravel 10 working on CircleCI.
edwh Sep 24, 2025
0dc3665
Getting Laravel 10 working on CircleCI.
edwh Sep 24, 2025
a362c51
Getting Laravel 10 working on CircleCI.
edwh Sep 24, 2025
1b4d713
Getting Laravel 10 working on CircleCI.
edwh Sep 24, 2025
ac9e698
Getting Laravel 10 working on CircleCI.
edwh Sep 24, 2025
8aa04c9
Getting Laravel 10 working on CircleCI.
edwh Sep 24, 2025
6cbe4a2
Getting Laravel 10 working on CircleCI.
edwh Sep 24, 2025
e6e35cc
Getting Laravel 10 working on CircleCI.
edwh Sep 24, 2025
dcc1283
Getting Laravel 10 working on CircleCI.
edwh Sep 24, 2025
77ec108
Getting Laravel 10 working on CircleCI.
edwh Sep 24, 2025
2bf3800
Getting Laravel 10 working on CircleCI.
edwh Sep 24, 2025
aa1dd3f
Getting Laravel 10 working on CircleCI.
edwh Sep 24, 2025
2040cca
Getting Laravel 10 working on CircleCI.
edwh Sep 25, 2025
705979b
Getting Laravel 10 working on CircleCI.
edwh Sep 25, 2025
7cd4438
Getting Laravel 10 working on CircleCI.
edwh Oct 1, 2025
7ea334e
Getting Laravel 10 working on CircleCI.
edwh Oct 1, 2025
4bd7dbf
Getting Laravel 10 working on CircleCI.
edwh Oct 1, 2025
8a3c212
Getting Laravel 10 working on CircleCI.
edwh Oct 1, 2025
6338e36
Getting Laravel 10 working on CircleCI.
edwh Oct 1, 2025
9dbf388
Getting Laravel 10 working on CircleCI.
edwh Oct 1, 2025
458ca4d
Getting Laravel 10 working on CircleCI.
edwh Oct 1, 2025
09083f1
Getting Laravel 10 working on CircleCI.
edwh Oct 1, 2025
24e4a01
Getting Laravel 10 working on CircleCI.
edwh Oct 2, 2025
61c5211
Getting Laravel 10 working on CircleCI.
edwh Oct 6, 2025
4b219f2
Getting Laravel 10 working on CircleCI.
edwh Oct 6, 2025
808fed5
Getting Laravel 10 working on CircleCI.
edwh Oct 6, 2025
d317f0d
Getting Laravel 10 working on CircleCI.
edwh Oct 7, 2025
74937f4
Getting Laravel 10 working on CircleCI.
edwh Oct 7, 2025
e6158e5
Getting Laravel 10 working on CircleCI.
edwh Oct 7, 2025
d01aab9
Getting Laravel 10 working - Vite issues.
edwh Oct 7, 2025
8200160
Getting Laravel 10 working - Playwright issues.
edwh Oct 7, 2025
7d73563
Getting Laravel 10 working - Playwright issues.
edwh Oct 7, 2025
3a69923
Rework of global JS broke Vue load.
edwh Oct 8, 2025
8c77294
Rework of global JS broke Vue load.
edwh Oct 8, 2025
1dd5f3b
Rework of global JS broke Vue load.
edwh Oct 8, 2025
322d7c8
Translation API has changed for JS.
edwh Oct 13, 2025
1dfc354
Closer to Playwright working.
edwh Oct 13, 2025
e6722a7
Closer to Playwright working.
edwh Oct 13, 2025
31e8aed
Closer to Playwright working.
edwh Oct 13, 2025
383a20d
Closer to Playwright working.
edwh Oct 17, 2025
1a08c9e
Closer to Playwright working.
edwh Oct 22, 2025
1a46f3e
Remove autocomplete playwright test
edwh Oct 22, 2025
f6fd5d7
More category tests.
edwh Oct 22, 2025
d2f2de4
Legacy password doesn't allow login after Laravel 10.
edwh Oct 29, 2025
1cb7896
Fix Docker startup and asset loading issues
edwh Nov 24, 2025
977684f
Fix Vue component JavaScript errors
edwh Nov 24, 2025
10d13bd
Fix htmlToText import for html-to-text v5 API
edwh Nov 24, 2025
258c8df
Remove lodash aliases causing text-clipper compatibility issues
edwh Nov 25, 2025
88ceedb
Restore most lodash aliases, only remove trimEnd/trimStart
edwh Nov 25, 2025
56204a7
Fix iframe stats sharing to use Vite assets
edwh Nov 25, 2025
37008e5
Add missing jQuery plugins to main header layout
edwh Nov 25, 2025
b67a843
Replace bootstrap-sortable tables with Bootstrap-Vue tables
edwh Nov 25, 2025
983b740
Remove Select2 dependency and replace with native selects
edwh Nov 25, 2025
6139c48
Remove tokenfield dependency
edwh Nov 25, 2025
1b68c00
Remove Slick carousel and replace with Bootstrap-Vue carousel
edwh Nov 25, 2025
6904d1e
Fix translation pluralization system
edwh Nov 25, 2025
2cae2ad
Fix group tags API URL syntax error
edwh Nov 25, 2025
9135d1c
Fix edit icon path for dev and production
edwh Nov 25, 2025
d1fbf94
Fix global app.js jQuery initialization timing
edwh Nov 25, 2025
37b72e0
Update package-lock.json dependencies
edwh Nov 25, 2025
98f69da
Adjust login page logo spacing
edwh Nov 25, 2025
7822df9
Fix stats bar wrapping and Leaflet map marker icon
edwh Dec 10, 2025
49c952b
RES-2054: Add network-scoped group tags API
edwh Dec 10, 2025
1baebb6
RES-2054: Add NC tag editing UI and user-based tag filtering
edwh Dec 10, 2025
72fa4bd
Fix RoleTest to work with Vue roles-table component
edwh Dec 10, 2025
9ca0169
Merge L10 RoleTest fix into group tags branch
edwh Dec 10, 2025
ac05648
Update GroupCreateTest to reflect NC tag editing permissions
edwh Dec 10, 2025
3db482b
RES-2054: Make global tags admin-only
edwh Dec 10, 2025
f6ff0fc
RES-2054: Complete tag visibility and network page Vue conversion
edwh Dec 17, 2025
decf426
RES-2054: Add pluralization support for network strings
edwh Dec 17, 2025
c9f8866
RES-2054: Pluralize stat labels (Group/Groups, Event/Events)
edwh Dec 17, 2025
d60519e
Revert docker-compose.yml mailhog port change
edwh Dec 17, 2025
ce087fc
Revert "Revert docker-compose.yml mailhog port change"
edwh Dec 17, 2025
cd403d9
Update Mailhog port to 8026 in Taskfile and docs
edwh Dec 17, 2025
7a4388f
Fix CheckTranslations to handle nested translation arrays
edwh Dec 17, 2025
665b5e4
Add debug output to testInviteReal for CI failure investigation
edwh Dec 18, 2025
9fe644b
Add French translations for network tags and stats
edwh Dec 18, 2025
6153f51
Fix French translation terminology consistency
edwh Dec 18, 2025
0a9780f
Fix testInviteReal debug output causing false failure
edwh Dec 18, 2025
28abfe6
Unauthenticated API calls return no tags
edwh Dec 18, 2025
aa38df5
Add debug output to testInvite for CI failure diagnosis
edwh Dec 18, 2025
ec84088
Fix testTags to authenticate before API call
edwh Dec 19, 2025
cee7e4b
Fix testListNetworkTags for unauthenticated empty response
edwh Dec 19, 2025
a1a4353
Fix testTagResourceIncludesGroupsCount to authenticate
edwh Dec 19, 2025
70c9680
Fix landing page layout and skills seeder
edwh Jan 15, 2026
fb0d492
Fix skills checkbox button styling on registration page
edwh Jan 15, 2026
90c9817
Add Vite dev server tasks and fix HMR configuration
edwh Jan 15, 2026
2775392
Add email validation Vue component for registration
edwh Jan 15, 2026
5a33aa2
Fix Vue component name mismatches for categories and roles tables
edwh Jan 15, 2026
41fcf19
Add timezone to expandEvent() for past events date/time display
edwh Jan 15, 2026
c06cb69
Move markAsRead route to authenticated middleware group
edwh Jan 15, 2026
8afe864
Fix empty hosts row and translation method calls
edwh Jan 15, 2026
f7b3fdb
Fix 'Add invites for group members' checkbox not populating emails
edwh Jan 23, 2026
8289134
Convert event invite modal from blade to Vue component
edwh Jan 23, 2026
664d50d
Fix post-release issues from testing
edwh Jan 23, 2026
45561e1
Merge upgrade-laravel-10x-restart into RES-2054_group_tags
edwh Jan 23, 2026
849fd6b
Add tag editing, filtering, and display improvements
edwh Jan 23, 2026
05e36fb
Eager-load group_tags and fix component property names
edwh Jan 23, 2026
c702c44
Filter tags in Group API resource based on user permissions
edwh Jan 23, 2026
a3c7c63
Filter tags in Group model toArray() for Blade serialization
edwh Jan 23, 2026
383a5c6
Fix iconv error on CSV export with special characters
edwh Jan 23, 2026
20b4913
Add Fly.io deployment config and graceful Discourse/Wiki handling
edwh Feb 2, 2026
6df8b6e
Fix translation check: remove unused coordinator_badge, add missing f…
edwh Feb 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
362 changes: 118 additions & 244 deletions .circleci/config.yml

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions .fly/scripts/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env bash

# Do NOT use set -e — we must always reach supervisord at the end
# so that nginx starts and the health check passes.

# Ensure storage directories exist
mkdir -p /var/www/storage/framework/{sessions,views,cache/data}
mkdir -p /var/www/storage/logs
mkdir -p /var/www/bootstrap/cache
chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache

# Substitute environment variables in nginx config for Tigris proxy.
if [ -n "$AWS_BUCKET" ]; then
export TIGRIS_BUCKET_URL="https://${AWS_BUCKET}.fly.storage.tigris.dev"
export TIGRIS_BUCKET_HOST="${AWS_BUCKET}.fly.storage.tigris.dev"
envsubst '${TIGRIS_BUCKET_URL} ${TIGRIS_BUCKET_HOST}' < /etc/nginx/nginx.conf > /etc/nginx/nginx.conf.tmp
mv /etc/nginx/nginx.conf.tmp /etc/nginx/nginx.conf
fi

# Run DB setup in a subshell so failures never prevent supervisord from starting
(
# Wait for MySQL to be reachable
echo "Waiting for database..."
DB_READY=0
for i in $(seq 1 30); do
if php /var/www/artisan migrate:status > /dev/null 2>&1; then
DB_READY=1
break
fi
echo " attempt $i/30 - database not ready, retrying..."
sleep 2
done

if [ "$DB_READY" = "1" ]; then
echo "Database ready, running migrations..."
php /var/www/artisan migrate --force || echo "WARNING: migrate failed"
timeout 30 php /var/www/artisan translations:import 2>/dev/null || true
else
echo "WARNING: Database not reachable after 60s, skipping migrations"
fi

# Cache config/routes/views for performance (non-fatal)
php /var/www/artisan config:cache 2>/dev/null || true
php /var/www/artisan route:cache 2>/dev/null || true
php /var/www/artisan view:cache 2>/dev/null || true
php /var/www/artisan queue:restart 2>/dev/null || true
) &

# Start supervisord immediately (manages nginx, php-fpm, cron)
# This ensures the health check can pass while DB setup runs in background
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
25 changes: 25 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Ensure shell scripts always use LF line endings
*.sh text eol=lf

# Auto detect text files and normalize line endings to LF
* text=auto eol=lf

# Ensure specific file types use LF
*.php text eol=lf
*.js text eol=lf
*.vue text eol=lf
*.json text eol=lf
*.md text eol=lf
*.yml text eol=lf
*.yaml text eol=lf

# Binary files
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.woff binary
*.woff2 binary
*.ttf binary
*.eot binary
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ restarters-anonymised.sql
/public/global
/public/js/app.js
/public/js/wiki.js
/public/js/resources_js_*.js
/public/css/app.css
/public/hot
/public/messages.js
/public/css/wiki.css
/.claude/settings.local.json
/public/build/
/storage/api-docs/api-docs.json
/.phpunit.result.cache
/playwright-report/
/events.csv
/public/repair-data*.csv
/uploads/*.jpg
55 changes: 47 additions & 8 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## CRITICAL: Docker Commands

**NEVER use `docker-compose` or `docker exec` directly. ALWAYS use `task` commands.**

```bash
# Starting containers
task docker:up-core # Core services only
task docker:up-debug # Core + debug tools (phpMyAdmin, Mailhog)
task docker:up-discourse # Core + Discourse
task docker:up-all # All services

# Stopping containers
task docker:down-core
task docker:down-debug
task docker:down-discourse
task docker:down-all

# Running commands in container
task docker:run:bash -- "npm run dev" # Run bash command
task docker:run:artisan -- migrate # Run artisan command
task docker:shell # Open shell in container

# Testing
task docker:test:phpunit # Run PHP tests
task docker:test:jest # Run JS tests
task docker:test:playwright # Run e2e tests

# Vite dev server (HMR)
task docker:vite:start # Start Vite in background
task docker:vite:stop # Stop Vite
task docker:vite # Start Vite in foreground (interactive)

# Logs and debugging
task docker:logs # View container logs
```

## Project Overview

Restarters.net is a suite of software for the repair community that brings together community repair enthusiasts and activists. It combines three core modules:
Expand All @@ -16,16 +52,16 @@ This is a Laravel 9 application with PHP 8+ that integrates with external servic

### Local Development Setup
```bash
# Using Docker (recommended for full development environment)
docker-compose up -d
# Using Docker (recommended) - see CRITICAL section above for task commands
task docker:up-debug # Start with debug tools

# The application will be available at:
# - Restarters: http://www.example.com:8001
# - phpMyAdmin: http://www.example.com:8002
# - Discourse: http://www.example.com:8003
# - Restarters: http://localhost:8001
# - phpMyAdmin: http://localhost:8002
# - Mailhog: http://localhost:8025

# Note: Add www.example.com to your hosts file pointing to your Docker host
# Run Vite for HMR (hot module replacement)
task docker:run:bash -- "npm run dev"
```

### Common Development Commands
Expand All @@ -44,7 +80,7 @@ php artisan migrate # Run database migrations
php artisan migrate:fresh # Fresh migration (drops all tables)
php artisan seed # Run database seeders
php artisan tinker # Laravel REPL
php artisan lang:js # Generate JavaScript translation files
# JavaScript translation files are now auto-generated by Vite laravel-translator plugin
php artisan translations:check # Check translation completeness

# Generate application key (for new installs)
Expand Down Expand Up @@ -147,4 +183,7 @@ npm test
- Only translate fr and fr-BE

## Development Warnings
- Don't try to test changes when you're running on Windows.
- Don't try to test changes when you're running on Windows.

## Workflow Guidelines
- When you create files, add them to git
16 changes: 14 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ RUN apt-get update && \
unzip \
npm \
vim \
netcat-openbsd \
default-mysql-client \
postgresql-client && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install Playwright system dependencies
# We need to install @playwright/test first to get the install-deps command
RUN npm install -g @playwright/test && \
npm install -g jest-junit && \
npx playwright install-deps && \
npm uninstall -g @playwright/test

ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/download/2.7.31/install-php-extensions /usr/local/bin/

RUN install-php-extensions \
Expand All @@ -23,6 +31,9 @@ RUN install-php-extensions \
xmlrpc \
xdebug \
intl \
exif \
pcntl \
curl \
gd

# Install composer. Don't run composer install yet - see docker_run.sh
Expand All @@ -46,9 +57,10 @@ RUN if getent group ${GID}; then \
useradd -m -u ${UID} -g restarter -s /bin/bash restarter; \
fi

# Dynamically update php-fpm to use the new user and group
# Dynamically update php-fpm to use the new user and group, and listen on all interfaces
RUN sed -i "s/user = www-data/user = restarter/g" /usr/local/etc/php-fpm.d/www.conf && \
sed -i "s/group = www-data/group = restarter/g" /usr/local/etc/php-fpm.d/www.conf
sed -i "s/group = www-data/group = restarter/g" /usr/local/etc/php-fpm.d/www.conf && \
sed -i "s/listen = 127.0.0.1:9000/listen = 0.0.0.0:9000/g" /usr/local/etc/php-fpm.d/www.conf

# Copy the code (this will be overridden by the volume mount in docker-compose)
COPY --chown=${UID}:${GID} . ./
Expand Down
123 changes: 123 additions & 0 deletions Dockerfile.fly
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# =============================================================================
# Stage 1: Build assets (Node + Composer)
# =============================================================================
FROM php:8.2-cli AS builder

# Install system dependencies for building
RUN apt-get update && apt-get install -y --no-install-recommends \
git zip unzip curl \
libpng-dev libjpeg62-turbo-dev libfreetype6-dev libzip-dev libicu-dev libxml2-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install pdo_mysql bcmath zip intl gd \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Install xmlrpc via pecl
RUN pecl install channel://pecl.php.net/xmlrpc-1.0.0RC3 && docker-php-ext-enable xmlrpc

# Install composer
COPY --from=composer/composer:2-bin /composer /usr/bin/composer

# Install Node 18
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

WORKDIR /build

# Copy composer files first for layer caching
COPY composer.json composer.lock ./
RUN composer install --no-dev --no-scripts --no-autoloader --prefer-dist

# Copy package files for npm layer caching
COPY package.json package-lock.json ./
RUN npm ci --legacy-peer-deps
RUN npx update-browserslist-db@latest

# Copy all source code
COPY . .

# Create a minimal .env for artisan commands during build (no DB needed)
RUN echo "APP_KEY=base64:$(openssl rand -base64 32)" > .env && \
echo "APP_ENV=production" >> .env

# Finish composer autoload (skip post-autoload scripts that need DB/app context)
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN composer dump-autoload --optimize --no-dev --no-scripts

# Run package discovery manually
RUN php artisan package:discover --ansi || true

# Build frontend assets
# The webpack.mix.js runs `php artisan lang:js` via WebpackShellPlugin, but that
# needs the full app bootstrapped. Generate translations first, then build.
RUN php artisan lang:js --no-lib resources/js/translations.js 2>/dev/null || true
RUN npm run production

# Generate swagger docs (non-fatal if it fails)
RUN php artisan l5-swagger:generate 2>/dev/null || true

# Remove build .env (real env comes from Fly secrets at runtime)
RUN rm -f .env

# =============================================================================
# Stage 2: Production image (Nginx + PHP-FPM + Supervisord + Cron)
# =============================================================================
FROM php:8.2-fpm

# Install runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
nginx \
supervisor \
cron \
gettext-base \
libpng-dev libjpeg62-turbo-dev libfreetype6-dev libzip-dev libicu-dev libxml2-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install pdo_mysql bcmath zip intl gd \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Install xmlrpc
RUN pecl install channel://pecl.php.net/xmlrpc-1.0.0RC3 && docker-php-ext-enable xmlrpc

# Configure PHP-FPM to use unix socket
RUN sed -i 's|listen = 127.0.0.1:9000|listen = /var/run/php-fpm.sock|' /usr/local/etc/php-fpm.d/www.conf && \
sed -i 's|;listen.owner = www-data|listen.owner = www-data|' /usr/local/etc/php-fpm.d/www.conf && \
sed -i 's|;listen.group = www-data|listen.group = www-data|' /usr/local/etc/php-fpm.d/www.conf && \
sed -i 's|;listen.mode = 0660|listen.mode = 0660|' /usr/local/etc/php-fpm.d/www.conf && \
rm -f /usr/local/etc/php-fpm.d/zz-docker.conf

# PHP production settings
RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/conf.d/php.ini && \
echo "upload_max_filesize = 100M" >> /usr/local/etc/php/conf.d/php.ini && \
echo "post_max_size = 100M" >> /usr/local/etc/php/conf.d/php.ini && \
echo "memory_limit = 256M" >> /usr/local/etc/php/conf.d/php.ini

# Copy nginx config
COPY docker/nginx-fly.conf /etc/nginx/nginx.conf

# Copy supervisord config
COPY docker/supervisord-fly.conf /etc/supervisor/conf.d/supervisord.conf

# Set up cron for Laravel scheduler (every minute)
RUN echo "* * * * * cd /var/www && php artisan schedule:run >> /dev/null 2>&1" | crontab -

# Set working directory
WORKDIR /var/www

# Copy application from builder
COPY --from=builder --chown=www-data:www-data /build /var/www

# Remove dev files not needed in production
RUN rm -rf node_modules tests .git .github

# Ensure storage and cache directories exist
RUN mkdir -p storage/framework/{sessions,views,cache/data} \
storage/logs bootstrap/cache \
&& chown -R www-data:www-data storage bootstrap/cache

# Copy startup script
COPY .fly/scripts/startup.sh /usr/local/bin/startup.sh
RUN chmod +x /usr/local/bin/startup.sh

EXPOSE 80

CMD ["/usr/local/bin/startup.sh"]
Loading