docs(readme): include dependencies installation in prerequisites

add sessions folder in .gitignore
This commit is contained in:
Yassine Doghri 2020-05-27 20:01:20 +02:00
parent 9070ca2651
commit d523597515
2 changed files with 50 additions and 18 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@
mariadb
phpmyadmin
sessions

View File

@ -51,8 +51,14 @@ database.default.password = castopod
> _NB._ You can tweak your environment by setting more environment variables. See the `./src/env` for examples or the [CodeIgniter4 User Guide](https://codeigniter.com/user_guide/index.html) for more info.
3. Add the repository you've cloned to docker desktop's `Settings` > `Resources` > `File Sharing`.
4. Install castopod's php dependencies
- The project's dependencies aren't included in the repository, you have to download them using the composer service defined in `docker-compose.yml`
### Start dev docker containers
```bash
docker-compose run --rm composer install --ignore-platform-reqs
```
### Start docker containers
Go to project's root folder and run:
@ -60,9 +66,15 @@ Go to project's root folder and run:
# starts all services declared in docker-compose.yml file
# -d option starts the containers in the background
docker-compose up -d
# See all running processes (you should see 3 processes running)
docker ps
# Alternatively, you can check all processes (you should see composer with an Exited status)
docker ps -a
```
> The command will boot 3 containers in the background:
> The `docker-compose up -d` command will boot 3 containers in the background:
>
> - `castopod_app`: a php based container with codeigniter requirements installed
> - `castopod_mariadb`: a [mariadb](https://mariadb.org/) server for persistent data
@ -70,22 +82,6 @@ docker-compose up -d
>
> _NB._ `./mariadb`, `./phpmyadmin` folders will be mounted in the project's root directory to persist data and logs.
### Install / update app dependencies using the `composer` service
The project's dependencies aren't included in the repository, you have to download them using the composer service defined in `docker-compose.yml`
```bash
docker-compose run --rm composer install --ignore-platform-reqs
```
Similarly, you can update the project's dependencies using the same service:
```bash
docker-compose run --rm composer update --ignore-platform-reqs
```
> _NB._ Both commands look for the `composer.json` file to find castopod's php dependencies, all of which live in the `./src/vendor` folder. For more info, check out [Composer documentation](https://getcomposer.org/doc/).
### Start hacking
You're all set! Start working your magic by updating the project's files! Help yourself to the [CodeIgniter4 User Guide](https://codeigniter.com/user_guide/index.html) for more insights.
@ -97,3 +93,38 @@ To see your changes, go to:
- **Username**: podlibre
- **Password**: castopod
---
### Going Further during development
#### Update app dependencies
You can update the project's dependencies using the `composer` service:
```bash
docker-compose run --rm composer update --ignore-platform-reqs
```
> _NB._ Composer commands look for the `composer.json` file to find castopod's php dependencies, all of which live in the `./src/vendor` folder. For more info, check out [Composer documentation](https://getcomposer.org/doc/).
#### Useful docker / docker-compose commands
```bash
# monitor the app container
docker logs --tail 50 --follow --timestamps castopod_app
# monitor the mariadb container
docker logs --tail 50 --follow --timestamps castopod_mariadb
# monitor the phpmyadmin container
docker logs --tail 50 --follow --timestamps castopod_phpmyadmin
# restart docker containers
docker-compose restart
# Destroy all containers, opposite of `up` command
docker-compose down
```
Check [docker](https://docs.docker.com/engine/reference/commandline/docker/) and [docker-compose](https://docs.docker.com/compose/reference/) documentations for more insights.