Change to single setup.

This commit is contained in:
Jan Eitzinger 2021-09-13 13:20:43 +02:00
parent 4436f76a63
commit f1bc23d11f
7 changed files with 116 additions and 299 deletions

3
.env
View File

@ -1,10 +1,11 @@
DATADIR=./data DATADIR=./data
CLUSTERCOCKPIT_BRANCH=develop
######################################################################## ########################################################################
# APP # APP
######################################################################## ########################################################################
APP_CLUSTERCOCKPIT_INIT=true APP_CLUSTERCOCKPIT_INIT=true
APP_ENVIRONMENT=prod APP_ENVIRONMENT=dev
######################################################################## ########################################################################
# PHP # PHP

View File

@ -9,6 +9,7 @@ if [ -d symfony ]; then
rm -rf symfony rm -rf symfony
sudo rm -rf job-archive sudo rm -rf job-archive
rm -rf influxdb/data/* rm -rf influxdb/data/*
rm -rf sqldata/*
echo "done." echo "done."
else else
echo "Aborting ..." echo "Aborting ..."

File diff suppressed because one or more lines are too long

View File

@ -1,47 +0,0 @@
services:
db:
volumes:
- ${DATADIR}/sqldata:/var/lib/mysql
influxdb:
container_name: cc-influxdb
image: influxdb
command: ["--reporting-disabled"]
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME: symfony
DOCKER_INFLUXDB_INIT_PASSWORD: ${INFLUXDB_PASSWORD}
DOCKER_INFLUXDB_INIT_ORG: ClusterCockpit
DOCKER_INFLUXDB_INIT_BUCKET: ClusterCockpit
DOCKER_INFLUXDB_INIT_RETENTION: 100w
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: ${INFLUXDB_ADMIN_TOKEN}
ports:
- "127.0.0.1:${INFLUXDB_PORT}:8086"
volumes:
- ${DATADIR}/influxdb/data:/var/lib/influxdb2
- ${DATADIR}/influxdb/config:/etc/influxdb2
openldap:
container_name: cc-ldap
image: osixia/openldap:1.5.0
command: --copy-service --loglevel debug
environment:
- LDAP_ADMIN_PASSWORD=${LDAP_ADMIN_PASSWORD}
- LDAP_ORGANISATION=${LDAP_ORGANISATION}
- LDAP_DOMAIN=${LDAP_DOMAIN}
volumes:
- ${DATADIR}/ldap:/container/service/slapd/assets/config/bootstrap/ldif/custom
ports:
- "127.0.0.1:389:389"
- "127.0.0.1:636:636"
phpmyadmin:
container_name: cc-phpmyadmin
image: phpmyadmin
environment:
- PMA_HOST=cc-db
- PMA_USER=root
- PMA_PASSWORD=${MYSQL_ROOT_PASSWORD}
ports:
- "127.0.0.1:${PHPMYADMIN_PORT}:80"
restart: always

View File

@ -1,71 +1,116 @@
services: services:
db: db:
container_name: cc-db container_name: cc-db
image: mysql:8.0.22 image: mysql:8.0.22
command: ["--default-authentication-plugin=mysql_native_password"] command: ["--default-authentication-plugin=mysql_native_password"]
environment: environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE} MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER} MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD} MYSQL_PASSWORD: ${MYSQL_PASSWORD}
volumes: volumes:
- ${DATADIR}/sql-init:/docker-entrypoint-initdb.d - ${DATADIR}/sql-init:/docker-entrypoint-initdb.d
cap_add: - ${DATADIR}/sqldata:/var/lib/mysql
- SYS_NICE cap_add:
- SYS_NICE
redis: influxdb:
container_name: cc-redis container_name: cc-influxdb
image: redis image: influxdb
command: [ command: ["--reporting-disabled"]
"redis-server", environment:
"--save", "", DOCKER_INFLUXDB_INIT_MODE: setup
"--maxmemory", "1gb", DOCKER_INFLUXDB_INIT_USERNAME: symfony
"--maxmemory-policy", "allkeys-lru"] DOCKER_INFLUXDB_INIT_PASSWORD: ${INFLUXDB_PASSWORD}
DOCKER_INFLUXDB_INIT_ORG: ClusterCockpit
DOCKER_INFLUXDB_INIT_BUCKET: ClusterCockpit
DOCKER_INFLUXDB_INIT_RETENTION: 100w
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: ${INFLUXDB_ADMIN_TOKEN}
ports:
- "127.0.0.1:${INFLUXDB_PORT}:8086"
volumes:
- ${DATADIR}/influxdb/data:/var/lib/influxdb2
- ${DATADIR}/influxdb/config:/etc/influxdb2
php: openldap:
container_name: cc-php container_name: cc-ldap
build: image: osixia/openldap:1.5.0
context: ./php-fpm command: --copy-service --loglevel debug
args: environment:
PHP_XDEBUG_INIT: ${PHP_XDEBUG_INIT} - LDAP_ADMIN_PASSWORD=${LDAP_ADMIN_PASSWORD}
PHP_XDEBUG_MODE: ${PHP_XDEBUG_MODE} - LDAP_ORGANISATION=${LDAP_ORGANISATION}
PHP_XDEBUG_CLIENT_PORT: ${PHP_XDEBUG_CLIENT_PORT} - LDAP_DOMAIN=${LDAP_DOMAIN}
PHP_XDEBUG_CLIENT_HOST: ${PHP_XDEBUG_CLIENT_HOST} volumes:
SYMFONY_CLI_VERSION: 4.23.2 - ${DATADIR}/ldap:/container/service/slapd/assets/config/bootstrap/ldif/custom
MYSQL_DATABASE: ${MYSQL_DATABASE} ports:
MYSQL_USER: ${MYSQL_USER} - "127.0.0.1:389:389"
MYSQL_PASSWORD: ${MYSQL_PASSWORD} - "127.0.0.1:636:636"
LDAP_PASSWORD: ${LDAP_ADMIN_PASSWORD}
INFLUXDB_PASSWORD: ${INFLUXDB_PASSWORD}
INFLUXDB_PORT: ${INFLUXDB_PORT}
INFLUXDB_ADMIN_TOKEN: ${INFLUXDB_ADMIN_TOKEN}
APP_ENVIRONMENT: ${APP_ENVIRONMENT}
environment:
- APP_CLUSTERCOCKPIT_INIT=${APP_CLUSTERCOCKPIT_INIT}
volumes:
- ${DATADIR}/symfony:/var/www/symfony:cached
- ${DATADIR}/job-archive:/var/lib/job-archive:cached
depends_on:
- db
- redis
nginx: redis:
container_name: cc-nginx container_name: cc-redis
build: image: redis
context: ./nginx command: [
args: "redis-server",
NGINX_SYMFONY_SERVER_NAME: ${NGINX_SYMFONY_SERVER_NAME} "--save", "",
MYSQL_PASSWORD: ${MYSQL_PASSWORD} "--maxmemory", "1gb",
INFLUXDB_PASSWORD: ${INFLUXDB_PASSWORD} "--maxmemory-policy", "allkeys-lru"]
APP_ENVIRONMENT: ${APP_ENVIRONMENT}
ports: php:
- "127.0.0.1:${NGINX_PORT}:80" container_name: cc-php
depends_on: build:
- php context: ./php-fpm
environment: args:
- NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx/conf.d PHP_XDEBUG_INIT: ${PHP_XDEBUG_INIT}
- NGINX_ENVSUBST_TEMPLATE_DIR=/etc/nginx/templates PHP_XDEBUG_MODE: ${PHP_XDEBUG_MODE}
- NGINX_ENVSUBST_TEMPLATE_SUFFIX=.template PHP_XDEBUG_CLIENT_PORT: ${PHP_XDEBUG_CLIENT_PORT}
- NGINX_SYMFONY_SERVER_NAME=${NGINX_SYMFONY_SERVER_NAME} PHP_XDEBUG_CLIENT_HOST: ${PHP_XDEBUG_CLIENT_HOST}
volumes: SYMFONY_CLI_VERSION: 4.23.2
- ${DATADIR}/symfony:/var/www/symfony:cached MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
LDAP_PASSWORD: ${LDAP_ADMIN_PASSWORD}
INFLUXDB_PASSWORD: ${INFLUXDB_PASSWORD}
INFLUXDB_PORT: ${INFLUXDB_PORT}
INFLUXDB_ADMIN_TOKEN: ${INFLUXDB_ADMIN_TOKEN}
APP_ENVIRONMENT: ${APP_ENVIRONMENT}
environment:
- APP_CLUSTERCOCKPIT_INIT=${APP_CLUSTERCOCKPIT_INIT}
- CLUSTERCOCKPIT_BRANCH=${CLUSTERCOCKPIT_BRANCH}
volumes:
- ${DATADIR}/symfony:/var/www/symfony:cached
- ${DATADIR}/job-archive:/var/lib/job-archive:cached
depends_on:
- db
- redis
nginx:
container_name: cc-nginx
build:
context: ./nginx
args:
NGINX_SYMFONY_SERVER_NAME: ${NGINX_SYMFONY_SERVER_NAME}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
INFLUXDB_PASSWORD: ${INFLUXDB_PASSWORD}
APP_ENVIRONMENT: ${APP_ENVIRONMENT}
ports:
- "127.0.0.1:${NGINX_PORT}:80"
depends_on:
- php
environment:
- NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx/conf.d
- NGINX_ENVSUBST_TEMPLATE_DIR=/etc/nginx/templates
- NGINX_ENVSUBST_TEMPLATE_SUFFIX=.template
- NGINX_SYMFONY_SERVER_NAME=${NGINX_SYMFONY_SERVER_NAME}
volumes:
- ${DATADIR}/symfony:/var/www/symfony:cached
phpmyadmin:
container_name: cc-phpmyadmin
image: phpmyadmin
environment:
- PMA_HOST=cc-db
- PMA_USER=root
- PMA_PASSWORD=${MYSQL_ROOT_PASSWORD}
ports:
- "127.0.0.1:${PHPMYADMIN_PORT}:80"
restart: always

View File

@ -1,13 +1,10 @@
#!/usr/bin/env bash #!/usr/bin/env bash
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 -b $CLUSTERCOCKPIT_BRANCH https://github.com/ClusterCockpit/ClusterCockpit .
if [ "$APP_ENV" = dev ]; then if [ "$APP_ENV" = dev ]; then
git checkout develop
composer install --no-progress --optimize-autoloader composer install --no-progress --optimize-autoloader
yarn install yarn install
yarn encore dev yarn encore dev