Corrections and improvements. Split compose into two files.

This commit is contained in:
Jan Eitzinger 2021-06-15 16:45:15 +02:00
parent 632f4bf04f
commit f66a44ae5a
5 changed files with 48 additions and 33 deletions

View File

@ -5,9 +5,9 @@ This is a setup for `docker compose` to try out a complete ClusterCockpit Applic
It creates containers for: It creates containers for:
* mysql * mysql
* influxdb * influxdb
* php-fpm (including the Symfony application) * php-fpm
* phpmyadmin
* nginx * nginx
* phpmyadmin (only in dev mode)
Ports and Passwords are configured in `.env`. Ports and Passwords are configured in `.env`.
@ -26,10 +26,10 @@ TODOS (There are probably a lot more!):
### Info ### Info
* Demo starts in production environment. * Demo starts in production environment.
* Uses prepared fixture data for databases (Changes will not be preserved). * Uses prepared fixture data for databases (Changes will not be preserved).
* ClusterCockpit will be initialized from scratch on every start (Changes will not be preserved). * ClusterCockpit is initialized from scratch on every container start (Changes will not be preserved).
### Setup ### Setup
The fixture data needs to be prepared once before the first start of the containers: The fixture data needs to be prepared once before first start of containers:
* `$ cd data` * `$ cd data`
* `$ ./init.sh` * `$ ./init.sh`
@ -37,7 +37,7 @@ After that from the root of the repository you can start up the containers with:
* `docker-compose up` * `docker-compose up`
* Wait... and wait a little longer * 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 the `NGINX_PORT` environment variable was changed, use `http://localhost:$PORT` .
Credentials for admin user are: Credentials for admin user are:
* User: `admin` * User: `admin`

View File

@ -2125,12 +2125,17 @@ INSERT INTO `user` (`id`, `username`, `password`, `name`, `roles`, `email`, `is_
(4, 'emmyUser3', NULL, 'Emmy User3', NULL, NULL, NULL, NULL), (4, 'emmyUser3', NULL, 'Emmy User3', NULL, NULL, NULL, NULL),
(5, 'emmyUser4', NULL, 'Emmy User4', NULL, NULL, NULL, NULL), (5, 'emmyUser4', NULL, 'Emmy User4', NULL, NULL, NULL, NULL),
(6, 'emmyUser5', NULL, 'Emmy User5', NULL, NULL, NULL, NULL), (6, 'emmyUser5', NULL, 'Emmy User5', NULL, NULL, NULL, NULL),
(7, 'woodyUser1', NULL, 'Woody User1', NULL, NULL, NULL, NULL), (7, 'emmyUser6', NULL, 'Emmy User6', NULL, NULL, NULL, NULL),
(8, 'woodyUser2', NULL, 'Woody User2', NULL, NULL, NULL, NULL), (8, 'emmyUser7', NULL, 'Emmy User7', NULL, NULL, NULL, NULL),
(9, 'woodyUser3', NULL, 'Woody User3', NULL, NULL, NULL, NULL), (9, 'emmyUser8', NULL, 'Emmy User8', NULL, NULL, NULL, NULL),
(10, 'woodyUser4', NULL, 'Woody User4', NULL, NULL, NULL, NULL), (10, 'emmyUser9', NULL, 'Emmy User9', NULL, NULL, NULL, NULL),
(11, 'woodyUser5', NULL, 'Woody User5', NULL, NULL, NULL, NULL), (11, 'emmyUser10', NULL, 'Emmy User10', NULL, NULL, NULL, NULL),
(12, 'demoUser', '$2y$10$A.Z9lQmDY/d0S1XhGMQWi..rtFWWdVi2A/9N96t6troj61iFi0rTS', 'Demo User', NULL, NULL, NULL, NULL); (12, 'woodyUser1', NULL, 'Woody User1', NULL, NULL, NULL, NULL),
(13, 'woodyUser2', NULL, 'Woody User2', NULL, NULL, NULL, NULL),
(14, 'woodyUser3', NULL, 'Woody User3', NULL, NULL, NULL, NULL),
(15, 'woodyUser4', NULL, 'Woody User4', NULL, NULL, NULL, NULL),
(16, 'woodyUser5', NULL, 'Woody User5', NULL, NULL, NULL, NULL),
(17, 'demoUser', '$2y$10$A.Z9lQmDY/d0S1XhGMQWi..rtFWWdVi2A/9N96t6troj61iFi0rTS', 'Demo User', NULL, NULL, NULL, NULL);
-- --
-- Indizes der exportierten Tabellen -- Indizes der exportierten Tabellen
@ -2197,7 +2202,7 @@ ALTER TABLE `job_tag`
-- AUTO_INCREMENT für Tabelle `user` -- AUTO_INCREMENT für Tabelle `user`
-- --
ALTER TABLE `user` ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
-- --
-- Constraints der exportierten Tabellen -- Constraints der exportierten Tabellen

20
docker-compose-dev.yml Normal file
View File

@ -0,0 +1,20 @@
services:
db:
volumes:
- ${DATADIR}/sql:/var/lib/mysql
influxdb:
volumes:
- ${DATADIR}/influxdb/data:/var/lib/influxdb2
- ${DATADIR}/influxdb/config:/etc/influxdb2
phpmyadmin:
container_name: cc-phpmyadmin
image: phpmyadmin
environment:
- PMA_HOST=db
- PMA_USER=root
- PMA_PASSWORD=${MYSQL_ROOT_PASSWORD}
ports:
- "127.0.0.1:${PHPMYADMIN_PORT}:80"
restart: always

View File

@ -9,8 +9,9 @@ services:
MYSQL_USER: symfony MYSQL_USER: symfony
MYSQL_PASSWORD: ${MYSQL_PASSWORD} MYSQL_PASSWORD: ${MYSQL_PASSWORD}
volumes: volumes:
# - ${DATADIR}/sql:/var/lib/mysql
- ${DATADIR}/sql:/docker-entrypoint-initdb.d - ${DATADIR}/sql:/docker-entrypoint-initdb.d
cap_add:
- SYS_NICE
influxdb: influxdb:
container_name: cc-influxdb container_name: cc-influxdb
@ -26,9 +27,6 @@ services:
DOCKER_INFLUXDB_INIT_BUCKET: ClusterCockpit DOCKER_INFLUXDB_INIT_BUCKET: ClusterCockpit
DOCKER_INFLUXDB_INIT_RETENTION: 2w DOCKER_INFLUXDB_INIT_RETENTION: 2w
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: ${INFLUXDB_ADMIN_TOKEN} DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: ${INFLUXDB_ADMIN_TOKEN}
# volumes:
# - ${DATADIR}/influxdb/data:/var/lib/influxdb2
# - ${DATADIR}/influxdb/config:/etc/influxdb2
php: php:
container_name: cc-php container_name: cc-php
@ -51,17 +49,6 @@ services:
- db - db
- influxdb - influxdb
phpmyadmin:
image: cc-phpmyadmin
container_name: phpmyadmin
environment:
- PMA_HOST=db
- PMA_USER=root
- PMA_PASSWORD=${MYSQL_ROOT_PASSWORD}
ports:
- "127.0.0.1:${PHPMYADMIN_PORT}:80"
restart: always
nginx: nginx:
container_name: cc-nginx container_name: cc-nginx
build: build:

View File

@ -3,13 +3,16 @@
if [ "$APP_CLUSTERCOCKPIT_INIT" = true ]; then if [ "$APP_CLUSTERCOCKPIT_INIT" = true ]; then
rm -rf /var/www/symfony/* /var/www/symfony/.??* rm -rf /var/www/symfony/* /var/www/symfony/.??*
git clone https://github.com/ClusterCockpit/ClusterCockpit . git clone https://github.com/ClusterCockpit/ClusterCockpit .
composer install --no-dev --no-progress --optimize-autoloader
yarn install yarn install
yarn encore production
#php bin/console doctrine:schema:create --no-interaction if [ "$APP_ENV" = dev ]; then
#php bin/console doctrine:migrations:migrate --no-interaction composer install --no-progress --optimize-autoloader
#php bin/console doctrine:fix:load --no-interaction yarn encore dev
else
composer install --no-dev --no-progress --optimize-autoloader
yarn encore production
fi
ln -s /var/lib/job-archive var/job-archive ln -s /var/lib/job-archive var/job-archive
fi fi