Skip to content

Commit

Permalink
Update readeMe
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Yves <[email protected]>
  • Loading branch information
docjyJ committed Jul 26, 2024
1 parent 5dbcf17 commit 68b5b77
Showing 1 changed file with 32 additions and 9 deletions.
41 changes: 32 additions & 9 deletions php/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,52 @@ This is the code for the PHP Docker controller.

## How to run

Running this locally requires Docker Engine on the same machine.
If this is the case, just execute the following command:
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:

```bash
composer install
sudo SKIP_DOMAIN_VALIDATION=true composer run dev # sudo is required to access docker socket
```

You can then access the web interface at `localhost:8080`.
### 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

If you have an error that says `Couldn't connect to server for http://127.0.0.1/v1.41/networks/create` makes sure a `nextcloud-aio-mastercontainer` is running.
You can start it with the following command:
### 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 :

```bash
sudo docker run \
docker run \
--rm \
--name nextcloud-aio-mastercontainer \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
nextcloud/all-in-one:latest
```

## Commands
### 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

| Command | Description |
|-----------------------------------------|----------------------------------------|
Expand Down

0 comments on commit 68b5b77

Please sign in to comment.