mirror of
				https://github.com/ClusterCockpit/cc-docker.git
				synced 2025-11-04 02:55:08 +01:00 
			
		
		
		
	Expose Influx port only in dev mode. Extend docs.
This commit is contained in:
		
							
								
								
									
										2
									
								
								.env
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								.env
									
									
									
									
									
								
							@@ -3,7 +3,7 @@ DATADIR=./data
 | 
			
		||||
# APP
 | 
			
		||||
########################################################################
 | 
			
		||||
APP_CLUSTERCOCKPIT_INIT=true
 | 
			
		||||
APP_ENVIRONMENT=prod
 | 
			
		||||
APP_ENVIRONMENT=prod  #either prod or dev
 | 
			
		||||
 | 
			
		||||
########################################################################
 | 
			
		||||
# MySQL
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										14
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								README.md
									
									
									
									
									
								
							@@ -49,31 +49,27 @@ To reuse an existing Symfony tree at `./data/symfony` you may change the environ
 | 
			
		||||
 | 
			
		||||
## Using for DEVELOP purpose
 | 
			
		||||
### Info
 | 
			
		||||
* `APP_ENVIRONMENT` variable in `.env` used to switch `php-fpm` container to development environment.
 | 
			
		||||
* `APP_ENVIRONMENT` variable in `.env` used to switch `php-fpm` container to development environement.
 | 
			
		||||
* `APP_CLUSTERCOCKPIT_INIT` variable in `.env` used to prevent container from initializing a new ClusterCockpit instance on every start.
 | 
			
		||||
* In this case, an existing Symfony tree at `./data/symfony` is required.
 | 
			
		||||
* Due to additional dependencies of the development environment, the instance has to be prepared with `composer` and `yarn` devel-options.
 | 
			
		||||
* By default, this also uses prepared fixture data for databases (Changes will not be preserved). In order to use an existing database, changes in `.env` and `docker-compose.yml` are required (see below).
 | 
			
		||||
* 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
 | 
			
		||||
If not using an existing database, the fixture data needs to be prepared before the first start of the containers:
 | 
			
		||||
* `$ cd data`
 | 
			
		||||
* `$ ./init.sh`
 | 
			
		||||
 | 
			
		||||
If an existing database is to be used, do the following:
 | 
			
		||||
* It is recommended to use the included MySQL container.
 | 
			
		||||
* Uncomment the mapping of default volume paths in `docker-compose.yml` for `cc-db` and/or `cc-influxdb` under `volumes` to persist the data across container restarts.
 | 
			
		||||
* Comment or delete the line `- ${DATADIR}/sql:/docker-entrypoint-initdb.d` for `cc-db` to disable initialisation of the MySQL database. You may also place an own MysQL database dump in `./data/sql`.
 | 
			
		||||
* Comment or delete the line `- ${DATADIR}/sql:/docker-entrypoint-initdb.d` for `cc-db` to disable initialisation of the MySQL database. You may also place your own MysQL database dump in `./data/sql`.
 | 
			
		||||
 | 
			
		||||
In `.env`, change the following variables under `APP`
 | 
			
		||||
* `APP_CLUSTERCOCKPIT_INIT` to `false`
 | 
			
		||||
* `APP_ENVIRONMENT` to `dev`
 | 
			
		||||
 | 
			
		||||
After that from the root of the repository you can start up the containers with:
 | 
			
		||||
* `docker-compose up`
 | 
			
		||||
* `docker-compose -f docker-compose.yml -f docker-compose-dev.yml up`
 | 
			
		||||
* Wait... and wait a little longer
 | 
			
		||||
 | 
			
		||||
By default, you can access ClusterCockpit in your browser at http://localhost . If NGINX_PORT environment variable was changed, use http://localhost:$PORT .
 | 
			
		||||
By default, you can access ClusterCockpit in your browser at http://localhost . If `NGINX_PORT` environment variable was changed, `use http://localhost:$PORT` .
 | 
			
		||||
 | 
			
		||||
If default database fixture were used, the credentials for admin user are:
 | 
			
		||||
* User: `admin`
 | 
			
		||||
 
 | 
			
		||||
@@ -4,6 +4,8 @@ services:
 | 
			
		||||
            - ${DATADIR}/sql:/var/lib/mysql
 | 
			
		||||
 | 
			
		||||
    influxdb:
 | 
			
		||||
        ports:
 | 
			
		||||
            - "127.0.0.1:${INFLUXDB_PORT}:8086"
 | 
			
		||||
        volumes:
 | 
			
		||||
            - ${DATADIR}/influxdb/data:/var/lib/influxdb2
 | 
			
		||||
            - ${DATADIR}/influxdb/config:/etc/influxdb2
 | 
			
		||||
 
 | 
			
		||||
@@ -17,8 +17,6 @@ services:
 | 
			
		||||
        container_name: cc-influxdb
 | 
			
		||||
        image: influxdb
 | 
			
		||||
        command: ["--reporting-disabled"]
 | 
			
		||||
        ports:
 | 
			
		||||
            - "127.0.0.1:${INFLUXDB_PORT}:8086"
 | 
			
		||||
        environment:
 | 
			
		||||
            DOCKER_INFLUXDB_INIT_MODE: setup
 | 
			
		||||
            DOCKER_INFLUXDB_INIT_USERNAME: symfony
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user