Initial Commit
commit
5c81fe5fa1
@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025 Nathan Steel
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@ -0,0 +1,48 @@
|
||||
# aLeaf
|
||||
|
||||
A website/framework built around leaf-php, containerised for convenience of differing PHP versions.
|
||||
If run on production (i.e. you're a server host), recommended to use a base install of nginx, php, etc. rather than the containers (for devops).
|
||||
|
||||
## Nginx Proxy Manager
|
||||
Run NPM (or just standard Nginx) on the server and route the container_name:port through there for ease of development on multiple sites/projects.
|
||||
|
||||
## Docker
|
||||
Dockerfile(s) are any run during the build process (so first instance of run, unless build specified).
|
||||
So use them to do the automatic scripting that you would otherwise need to do manually, i.e. database creations, imports, etc for first run.
|
||||
|
||||
### Rebuild with Dockerfiles
|
||||
sudo docker compose down && sudo docker compose build --no-cache && sudo docker compose up -d --force-recreate --build
|
||||
--build at end may not be needed, but was for me
|
||||
|
||||
### Just restart
|
||||
sudo docker compose down && sudo docker compose up -d
|
||||
|
||||
#### Replacing DB with docker build
|
||||
You will need to delete the mysql folder I believe.
|
||||
```sudo rm -rf /home/nathan/docker_vol/aleaf_mariadb```
|
||||
Once it's run/built once I recommend using a script to replace/re-import data, etc.
|
||||
|
||||
|
||||
## Accessing the container
|
||||
sudo docker exec -it aLeaf-php /bin/bash # For running leaf scripts/composer, etc
|
||||
sudo docker exec -it aLeaf-mariadb mysql -unathan -p # For SQL
|
||||
sudo docker exec aLeaf-mariadb mysql < <script_file> # To run a script file (maybe)
|
||||
sudo docker exec -it aLeaf-nginx /bin/bash # To check nginx issues
|
||||
sudo docker exec -it aLeaf-nginx nginx -s reload # Restart nginx (not the container, just the service)
|
||||
|
||||
## Multiple sites on same docker stack (just in case)
|
||||
|
||||
## Leaf uses apache, I use nginx
|
||||
https://winginx.com/en/htaccess
|
||||
htaccess files generated can be switched to nginx with this
|
||||
|
||||
## TODO
|
||||
- inotifywait/entr on default.conf change, to restart nginx server on container
|
||||
|
||||
## Leaf create (cli to make a starter app if nothing already)
|
||||
leaf create my-app --mvc
|
||||
leaf create basic --basic
|
||||
composer create-project leafs/mvc:v4.0-beta my-app
|
||||
|
||||
## Shared folders in windows (virtualbox) VMs
|
||||
Need to do this or symlinks don't work, and that messes up a bunch of composer stuff
|
||||
Loading…
Reference in New Issue