Skip to content

Commit

Permalink
feat: change to generate files on project root
Browse files Browse the repository at this point in the history
  • Loading branch information
ejklock authored Mar 20, 2024
1 parent 840b404 commit d142cdf
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/docker-dev-lamp-env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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': [
Expand All @@ -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'
Expand Down Expand Up @@ -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')

Expand Down Expand Up @@ -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}")

0 comments on commit d142cdf

Please sign in to comment.