cc-docker/README.md

94 lines
4.3 KiB
Markdown
Raw Normal View History

2021-05-19 07:49:23 +02:00
# cc-docker
2021-05-19 07:53:28 +02:00
2021-07-05 08:44:09 +02:00
This is a setup for `docker compose` to try out a complete ClusterCockpit Application Stack including all external components. This docker setup is intended for demo purposes, but can be easily configured to be used as a development environment for ClusterCockpit.
2021-05-19 14:56:25 +02:00
2021-06-14 11:09:57 +02:00
It creates containers for:
2021-05-19 14:56:25 +02:00
* mysql
* php-fpm
2021-05-19 14:56:25 +02:00
* nginx
2021-09-07 16:17:37 +02:00
* redis
2021-09-07 16:14:14 +02:00
* openldap
2021-06-22 13:37:35 +02:00
* influxdb (only in dev mode)
2021-06-23 14:43:34 +02:00
* phpmyadmin (only in dev mode), this did not work with Chrome for me.
2021-05-19 14:56:25 +02:00
2021-06-14 11:09:57 +02:00
Ports and Passwords are configured in `.env`.
2021-05-19 07:53:28 +02:00
## Known Issues
2021-06-09 09:53:35 +02:00
2021-06-10 13:21:59 +02:00
* `docker-compose` installed on Ubuntu (18.04, 20.04) via `apt-get` can not correctly parse `docker-compose.yml` due to version differences. Install latest version of `docker-compose` from https://docs.docker.com/compose/install/ instead.
2021-06-10 12:08:22 +02:00
* You need to ensure that no other web server is running on port 80 (e.g. Apache2). If port 80 is already in use, edit NGINX_PORT environment variable in `.env`.
* Existing VPN connections sometimes cause problems with docker. If `docker-compose` does not start up correctly, try disabling any active VPN connection. Refer to https://stackoverflow.com/questions/45692255/how-make-openvpn-work-with-docker for further information.
## Using for DEMO purpose
### Info
2021-08-02 11:13:07 +02:00
* The demo starts in Symfony production environment.
* It uses prepared fixture data for databases (Changes will not be preserved).
* ClusterCockpit is checked out and initialized from scratch on every container start (Changes will not be preserved).
### Setup
The fixture data needs to be prepared once before first start of containers:
* `$ cd data`
* `$ ./init.sh`
2021-06-09 09:53:35 +02:00
After that from the root of the repository you can start up the containers with:
* `docker-compose up`
* Wait... and wait a little longer
By default, you can access ClusterCockpit in your browser at http://localhost . If the `NGINX_PORT` environment variable was changed, use `http://localhost:$PORT` .
2021-06-10 12:08:22 +02:00
2021-06-09 09:53:35 +02:00
Credentials for admin user are:
* User: `admin`
* Password: `AdminDev`
2021-06-10 12:08:22 +02:00
You can shutdown the containers by pressing `CTRL-C`.
2021-06-09 09:55:54 +02:00
To reuse an existing Symfony tree at `./data/symfony` you may change the environment variable `APP_CLUSTERCOCKPIT_INIT` in `.env` from `true` to `false`.
## Using for DEVELOP purpose
### Info
2021-08-02 12:47:50 +02:00
* The `APP_ENVIRONMENT` variable in `.env` is used to switch the `php-fpm` container to development environment.
* The `APP_CLUSTERCOCKPIT_INIT` variable in `.env` is used to prevent the container from initializing a new ClusterCockpit instance on every start.
* In this case, an existing Symfony tree at `./data/symfony` is required.
* By default, this also uses prepared fixture data for databases. In order to use an existing database, changes in `.env` and `docker-compose.yml` are required (see below).
### Setup
2021-06-22 13:36:08 +02:00
This description assumes you will let the docker setup initialize the symfony tree and data fixtures for you.
If not using an existing database, the fixture data needs to be prepared before the first start of the containers:
* `$ cd data`
2021-06-22 13:36:08 +02:00
* `$ ./init.sh dev`
In `.env`, change the following variables under `APP`
* `APP_ENVIRONMENT` to `dev`
2021-06-23 14:33:25 +02:00
In case you want to switch from Demo to Develop you have to purge previous images. This command will purge **ALL** your docker images:
```
$ docker images -a -q | xargs docker rmi -f
```
Check with:
```
$ docker images
```
that all images are gone.
2021-06-22 13:36:08 +02:00
After that from the root of the repository you can start up the containers with (use -d switch to startup in detached mode):
* `docker-compose -f docker-compose.yml -f docker-compose-dev.yml up`
* Wait... and wait a little longer
2021-06-15 17:45:18 +02:00
After the initial setup you have to:
* Comment or delete the line `- ${DATADIR}/sql:/docker-entrypoint-initdb.d` for `cc-db` to disable initialisation of the MySQL database.
* Set `APP_CLUSTERCOCKPIT_INIT` to `false` in the .env file
2021-06-22 13:36:08 +02:00
On subsequent start of the containers you will then reuse the persisted volume data located in the `./data` directory.
2021-06-15 17:45:18 +02:00
2021-06-15 17:12:28 +02:00
By default, you can access ClusterCockpit in your browser at `http://localhost`.
If `NGINX_PORT` environment variable was changed, `use http://localhost:$PORT`.
The InfluxDB Web interface can be accessed at `http://localhost:8086` using the credentials set in `.env`.
2021-06-15 17:36:17 +02:00
PHPMyAdmin can be reached at `http://localhost:8080`.
If default database fixture were used, the credentials for admin user are:
* User: `admin`
* Password: `AdminDev`
2021-06-22 13:36:08 +02:00
You can shutdown the containers by pressing `CTRL-C` if not started in detached mode.