From dfa7a916481f242a33339042756bbf5517fce00a Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Wed, 25 Aug 2021 11:24:24 +0200 Subject: [PATCH] Cleanup and fix inconsistencies. Remove ping check for github. --- .env | 3 ++- docker-compose-dev.yml | 2 +- docker-compose.yml | 8 +++++--- php-fpm/Dockerfile | 12 +++++++----- php-fpm/entrypoint.sh | 6 ------ 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.env b/.env index 3d95931..8f82c01 100644 --- a/.env +++ b/.env @@ -8,9 +8,10 @@ APP_ENVIRONMENT=prod ######################################################################## # MySQL +# The SQL port is not exposed outside the container ######################################################################## MYSQL_ROOT_PASSWORD=root -MYSQL_DATABASE=symfony +MYSQL_DATABASE=ClusterCockpit MYSQL_USER=symfony MYSQL_PASSWORD=symfony diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 5edcd9c..5ec75c9 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -25,7 +25,7 @@ services: container_name: cc-phpmyadmin image: phpmyadmin environment: - - PMA_HOST=db + - PMA_HOST=cc-db - PMA_USER=root - PMA_PASSWORD=${MYSQL_ROOT_PASSWORD} ports: diff --git a/docker-compose.yml b/docker-compose.yml index b78e198..0a0ee11 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,8 +5,8 @@ services: command: ["--default-authentication-plugin=mysql_native_password"] environment: MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} - MYSQL_DATABASE: ClusterCockpit - MYSQL_USER: symfony + MYSQL_DATABASE: ${MYSQL_DATABASE} + MYSQL_USER: ${MYSQL_USER} MYSQL_PASSWORD: ${MYSQL_PASSWORD} volumes: - ${DATADIR}/sql-init:/docker-entrypoint-initdb.d @@ -28,8 +28,11 @@ services: context: ./php-fpm args: SYMFONY_CLI_VERSION: 4.23.2 + MYSQL_DATABASE: ${MYSQL_DATABASE} + MYSQL_USER: ${MYSQL_USER} MYSQL_PASSWORD: ${MYSQL_PASSWORD} INFLUXDB_PASSWORD: ${INFLUXDB_PASSWORD} + INFLUXDB_PORT: ${INFLUXDB_PORT} INFLUXDB_ADMIN_TOKEN: ${INFLUXDB_ADMIN_TOKEN} APP_ENVIRONMENT: ${APP_ENVIRONMENT} environment: @@ -61,4 +64,3 @@ services: - NGINX_SYMFONY_SERVER_NAME=${NGINX_SYMFONY_SERVER_NAME} volumes: - ${DATADIR}/symfony:/var/www/symfony:cached - diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index dd63425..9a4c7d9 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -70,14 +70,16 @@ ARG APP_ENVIRONMENT ENV APP_ENV=${APP_ENVIRONMENT} ENV APP_SECRET=67d829bf61dc5f87a73fd814e2c9f629 ENV APP_DEBUG=1 +ENV REDIS_URL=redis://cc-redis +ARG INFLUXDB_PORT ARG INFLUXDB_PASSWORD ARG INFLUXDB_ADMIN_TOKEN -ARG MYSQL_PASSWORD -ENV INFLUXDB_URL=influxdb://symfony:${INFLUXDB_PASSWORD}@cc-influxdb:8086/ClusterCockpit -ENV INFLUXDB_V2_URL=http://cc-influxdb:8086 -ENV REDIS_URL=redis://cc-redis +ENV INFLUXDB_URL=http://cc-influxdb:${INFLUXDB_PORT} ENV INFLUXDB_TOKEN=${INFLUXDB_ADMIN_TOKEN} -ENV DATABASE_URL=mysql://symfony:${MYSQL_PASSWORD}@db:3306/ClusterCockpit +ARG MYSQL_USER +ARG MYSQL_PASSWORD +ARG MYSQL_DATABASE +ENV DATABASE_URL=mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@cc-db:3306/${MYSQL_DATABASE} ENV CORS_ALLOW_ORIGIN=^https?://(localhost|127\\.0\\.0\\.1)(:[0-9]+)?$ WORKDIR /var/www/symfony diff --git a/php-fpm/entrypoint.sh b/php-fpm/entrypoint.sh index 063541a..88c233a 100755 --- a/php-fpm/entrypoint.sh +++ b/php-fpm/entrypoint.sh @@ -2,12 +2,6 @@ if [ "$APP_CLUSTERCOCKPIT_INIT" = true ]; then - # Wait for docker dns able to resolve gitub - # Solves weird special case of container loading faster than github can be reached - until ping -c 1 github.com > /dev/null ; do - echo "Could not reach github.com yet ..." - sleep 1 - done rm -rf /var/www/symfony/* /var/www/symfony/.??* git clone https://github.com/ClusterCockpit/ClusterCockpit .