2021-11-30 18:20:42 +08:00
|
|
|
# PHP Docker Controller
|
|
|
|
|
|
|
|
This is the code for the PHP Docker controller.
|
|
|
|
|
|
|
|
## How to run
|
|
|
|
|
2024-07-26 23:39:36 +08:00
|
|
|
Running this locally requires :
|
|
|
|
|
|
|
|
### 1. Install the development environment
|
|
|
|
|
|
|
|
This project uses Composer as dependency management software. It is very similar to NPM.
|
|
|
|
The command to install all dependencies is:
|
2021-11-30 18:20:42 +08:00
|
|
|
|
2024-07-26 00:12:58 +08:00
|
|
|
```bash
|
|
|
|
composer install
|
2021-11-30 18:20:42 +08:00
|
|
|
```
|
|
|
|
|
2024-07-26 23:39:36 +08:00
|
|
|
### 2. Access to docker socket
|
|
|
|
|
|
|
|
The `root` user has all privileges including access to the Docker socket.
|
|
|
|
But **it is not recommended to launch the local instance with full privileges**, consider the docker group for docker access without being `root`.
|
|
|
|
See https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user
|
2024-07-26 00:12:58 +08:00
|
|
|
|
2024-07-26 23:39:36 +08:00
|
|
|
### 3. Run a `nextcloud-aio-mastercontainer` container
|
|
|
|
|
|
|
|
This application manages containers, including its own container.
|
|
|
|
So you need to run a `nextcloud-aio-mastercontainer` container for the application to work properly.
|
|
|
|
|
|
|
|
Here is a command to quickly launch a container :
|
2024-07-26 00:12:58 +08:00
|
|
|
|
|
|
|
```bash
|
2024-07-26 23:39:36 +08:00
|
|
|
docker run \
|
2024-07-26 00:12:58 +08:00
|
|
|
--rm \
|
|
|
|
--name nextcloud-aio-mastercontainer \
|
|
|
|
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
|
|
|
|
nextcloud/all-in-one:latest
|
|
|
|
```
|
|
|
|
|
2024-07-26 23:39:36 +08:00
|
|
|
### 4. Start your server
|
|
|
|
|
|
|
|
With this command you will launch the server:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# Make sure to launch this command with a user having access to the docker socket.
|
|
|
|
SKIP_DOMAIN_VALIDATION=true composer run dev
|
|
|
|
```
|
|
|
|
|
|
|
|
You can then access the web interface at http://localhost:8080.
|
|
|
|
|
|
|
|
Note: You can restart the server by preceding the command with other environment variables.
|
|
|
|
|
|
|
|
## Composer routine
|
2024-07-26 00:12:58 +08:00
|
|
|
|
|
|
|
| Command | Description |
|
|
|
|
|-----------------------------------------|----------------------------------------|
|
|
|
|
| `composer run dev` | Starts the development server |
|
|
|
|
| `composer run psalm` | Run Psalm static analysis |
|
|
|
|
| `composer run psalm:update-baseline` | Run Psalm with `--update-baseline` arg |
|
|
|
|
| `composer run lint` | Run PHP Syntax check |
|
|
|
|
| `composer run lint:twig` | Run Twig Syntax check |
|
|
|
|
| `composer run php-deprecation-detector` | Run PHP Deprecation Detector |
|
|
|
|
|
|
|
|
|