From d142cdffafe3d229838270e7f6a9dcf79ed3ee8e Mon Sep 17 00:00:00 2001 From: Evaldo Klock Date: Wed, 20 Mar 2024 09:23:24 -0400 Subject: [PATCH] feat: change to generate files on project root --- src/docker-dev-lamp-env.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/docker-dev-lamp-env.py b/src/docker-dev-lamp-env.py index 0c9e1af..c3c186a 100644 --- a/src/docker-dev-lamp-env.py +++ b/src/docker-dev-lamp-env.py @@ -32,7 +32,7 @@ ], 'restart': 'unless-stopped', 'volumes': [ - './app:/var/www/app', + './:/var/www/app', './docker-compose/php-fpm/custom.ini:/usr/local/etc/php/conf.d/custom.ini', ], 'working_dir': '/var/www/app' @@ -42,16 +42,16 @@ 'command': '--default-authentication-plugin=mysql_native_password', 'container_name': f'{appName}-dev-db', 'environment': { - 'MYSQL_DATABASE': '${DB_DATABASE}', - 'MYSQL_PASSWORD': '${DB_PASSWORD}', - 'MYSQL_ROOT_PASSWORD': '${DB_PASSWORD}', - 'MYSQL_USER': '${DB_USERNAME}', + 'MYSQL_DATABASE': f'{appName}', + 'MYSQL_PASSWORD': f'{appName}', + 'MYSQL_ROOT_PASSWORD': f'{appName}', + 'MYSQL_USER': f'{appName}', 'SERVICE_NAME': 'mysql', 'SERVICE_TAGS': 'dev' }, 'image': 'mysql:5.7', 'networks': [f'{appName}Network'], - 'ports': ['${DB_EXTERNAL_PORT}:${DB_PORT}'], + 'ports': '33306:3306', 'restart': 'unless-stopped', 'tty': True, 'volumes': [ @@ -67,7 +67,7 @@ 'ports': ['8000:80'], 'restart': 'unless-stopped', 'volumes': [ - './app:/var/www/app', + './:/var/www/app', './docker-compose/nginx:/etc/nginx/conf.d/' ], 'working_dir': '/var/www/app' @@ -115,16 +115,16 @@ def generateFileWithPath(path,content,lines=False,isYaml=False): generateFileWithPath(dockerComposeFile,data,False,True) -print('Gerando arquivo .env do ambiente docker\n') +# print('Gerando arquivo .env do ambiente docker\n') -generateFileWithPath(envFile,[ - "DB_HOST=db\n", - "DB_PORT=3306\n", - "DB_EXTERNAL_PORT=33306\n", - f"DB_DATABASE={appName}\n", - f"DB_USERNAME={appName}\n", - f'DB_PASSWORD={appName}\n', - ],True) +# generateFileWithPath(envFile,[ +# "DB_HOST=db\n", +# "DB_PORT=3306\n", +# "DB_EXTERNAL_PORT=33306\n", +# f"DB_DATABASE={appName}\n", +# f"DB_USERNAME={appName}\n", +# f'DB_PASSWORD={appName}\n', +# ],True) print('Criando app.conf do nginx\n') @@ -165,9 +165,9 @@ def generateFileWithPath(path,content,lines=False,isYaml=False): print(f'Clonando repositório {gitRepoUrl}\n') -Repo.clone_from(gitRepoUrl, f"{appName}/app",progress=CloneProgress()) +Repo.clone_from(gitRepoUrl, f"{appName}",progress=CloneProgress()) print(f'\n Seu ambiente PHP foi criado com sucesso. Acesse a pasta {appName}\n') -##os.system(f"git clone {gitRepoUrl} {appName}/app") +##os.system(f"git clone {gitRepoUrl} {appName}")