|
|
6 дней назад | |
|---|---|---|
| app | 6 дней назад | |
| docker | 6 дней назад | |
| .env.example | 6 дней назад | |
| .gitignore | 6 дней назад | |
| README.md | 6 дней назад | |
| docker-compose.yml | 6 дней назад | |
Two containers:
intl, zip, mbstring extensions CakePHP needs). Used on demand to scaffold/manage the app; it isn't a long-running service.intl, pdo_mysql, mbstring, zip, gd, mod_rewrite) serving ./app/webroot.cakephp, user cakephp / password cakephp (root password root). Data persists in the db_data named volume. Port 3306 is published to the host if you want to connect with a GUI client (Workbench, TablePlus, etc.).composer and web share the ./app directory as the CakePHP application root. app/config/app_local.php is already pointed at the db service (host db, database/user/password cakephp).
The app was scaffolded with:
docker compose build
docker compose run --rm --entrypoint sh composer -c \
"composer create-project --prefer-dist cakephp/app /tmp/app --no-interaction && cp -a /tmp/app/. /var/www/html/"
(Scaffolding via /tmp inside the container and copying out avoids a Composer bug deleting temp files directly on a Windows bind mount.)
Start the site:
docker compose up -d web
Visit http://localhost:8080
Run Composer commands against the app (e.g. installing a plugin):
docker compose run --rm composer require cakephp/authentication
Run bin/cake console commands via the web container:
docker compose exec web php bin/cake.php bake controller Articles
Bring the DB up alongside the app:
docker compose up -d db web
Run migrations/bake against it once you have tables:
docker compose exec web php bin/cake.php migrations migrate
Connect from a host GUI client at 127.0.0.1:3306 using cakephp / cakephp (or root / root).
The Geo plugin is installed and loaded (app/src/Application.php). Setup:
app/config/app.php under Geocoder.LeafletHelper) are served by MapTiler, configured under Leaflet.tileLayer.Both need API keys, passed into the web container as environment variables:
cp .env.example .env
# edit .env and set GOOGLE_MAPS_API_KEY and MAPTILER_API_KEY
docker compose up -d web
Without keys, geocoding calls and map tiles will fail/return blank tiles, but the rest of the app is unaffected.
Powered by TurnKey Linux.