<commit_before>#!/usr/bin/env python3

# MAINTAINER Pierre-Antoine 'ZHAJOR' Tible <<EMAIL>>

import argparse
import os.path

"""The list of available images"""
images_available = {'api':
                        {'laravel': 'zhajor/docker-apache-2.4-php5.6-for-laravel',
                         'phalcon': 'zhajor/docker-apache-php7-phalcon'},
                    'db':
                        {'postgres': 'postgres:latest'},
                    'front':
                        {'angular': 'zhajor/docker-apache-2.4-proxy'},
                    'db_administration':
                        {'phppgadmin': 'zhajor/docker-phppgadmin'}
                    }

"""The image to use when the parameter --api or --front or --db or --db-admin is not set"""
default_image = {'api': images_available['api']['phalcon'],
                 'db': images_available['db']['postgres'],
                 'front': images_available['front']['angular'],
                 'db_administration': images_available['db_administration']['phppgadmin']}

default_compose_version = 2

api_configuration = {
    'image': default_image['api'],
    'ports': [80],
    'container-name': 'api',
    'volumes': [['./api', '/var/www/html']],
    'networks': [['net', ['api']]]
}

front_configuration = {
    'image': default_image['front'],
    'ports': [80],
    'container-name': 'front',
    'volumes': [['./front', '/var/www/html']],
    'networks': [['net', ['front']]],
    'environments': [['proxy', '/api'], ['proxy-host', 'http://api']]
}

db_configuration = {
    'image': default_image['db'],
    'container-name': 'db',
    'volumes': [['./database/data', '/var/lib/postgresql/data']],
    'networks': [['net', ['database']]],
    'environments': [['POSTGRES_USER', '/api'],
                     ['POSTGRES_DB', 'http://api'],
                     ['POSTGRES_PASSWORD', 'http://api']]
}

db_administration_configuration = {
    'image': default_image['db_administration'],
    'ports': [80],
    'container-name': 'db_administration',
    'networks': [['net', ['phppgadmin']]],
    'environments': [['DB_PORT', '5432'],
                     ['DB_HOST', 'http://database']]
}


parser = argparse.ArgumentParser(description='Create your docker-compose configuration within a minute')
parser.add_argument('--name', help='The project name', required=True, metavar='my-project')
parser.add_argument('--port', help='The port', required=True, metavar='24000')
parser.add_argument('--file', help='The output file name', metavar='docker-compose.yml', default='docker-compose.yml')
parser.add_argument('--no-front', dest='no_front', help='Do not use a front container', action='store_true')
parser.add_argument('--no-api', dest='no_api', help='Do not use an api container', action='store_true')
parser.add_argument('--no-db', dest='no_db', help='Do not use a db container', action='store_true')
parser.add_argument('--no-db-admin', dest='no_db_admin', help='Do not use a db configuration container', action='store_true')
parser.add_argument('--api', help='The image to use for an api', metavar='phalcon')
parser.add_argument('--front', help='The image to use for an api', metavar='angular')
parser.add_argument('--db', help='The image to use for an api', metavar='postgres')
parser.add_argument('--db-admin', help='The image to use for an api', metavar='phppgadmin')
args = parser.parse_args()

defined_port = int(args.port)
defined_base_container_name = args.name + "-"
document = "version: '" + str(default_compose_version) + "'\n\nservices:\n"
default_networks = "networks:\n  net:"


def check_images(args):
    if args.api is not None:
        api_configuration['image'] = images_available['api'][args.api]
    if args.front is not None:<commit_msg>Issue with database fixed<commit_after>#!/usr/bin/env python3

# MAINTAINER Pierre-Antoine 'ZHAJOR' Tible <<EMAIL>>

import argparse
import os.path

"""The list of available images"""
images_available = {'api':
                        {'laravel': 'zhajor/docker-apache-2.4-php5.6-for-laravel',
                         'phalcon': 'zhajor/docker-apache-php7-phalcon'},
                    'db':
                        {'postgres': 'postgres:latest'},
                    'front':
                        {'angular': 'zhajor/docker-apache-2.4-proxy'},
                    'db_administration':
                        {'phppgadmin': 'zhajor/docker-phppgadmin'}
                    }

"""The image to use when the parameter --api or --front or --db or --db-admin is not set"""
default_image = {'api': images_available['api']['phalcon'],
                 'db': images_available['db']['postgres'],
                 'front': images_available['front']['angular'],
                 'db_administration': images_available['db_administration']['phppgadmin']}

default_compose_version = 2

api_configuration = {
    'image': default_image['api'],
    'ports': [80],
    'container-name': 'api',
    'volumes': [['./api', '/var/www/html']],
    'networks': [['net', ['api']]]
}

front_configuration = {
    'image': default_image['front'],
    'ports': [80],
    'container-name': 'front',
    'volumes': [['./front', '/var/www/html']],
    'networks': [['net', ['front']]],
    'environments': [['proxy', '/api'], ['proxy-host', 'http://api']]
}

db_configuration = {
    'image': default_image['db'],
    'container-name': 'db',
    'volumes': [['./database/data', '/var/lib/postgresql/data']],
    'networks': [['net', ['database']]],
    'environments': [['POSTGRES_USER', 'postgres'],
                     ['POSTGRES_DB', 'postgres'],
                     ['POSTGRES_PASSWORD', 'postgres']]
}

db_administration_configuration = {
    'image': default_image['db_administration'],
    'ports': [80],
    'container-name': 'db_administration',
    'networks': [['net', ['phppgadmin']]],
    'environments': [['DB_PORT', '5432'],
                     ['DB_HOST', 'database']]
}


parser = argparse.ArgumentParser(description='Create your docker-compose configuration within a minute')
parser.add_argument('--name', help='The project name', required=True, metavar='my-project')
parser.add_argument('--port', help='The port', required=True, metavar='24000')
parser.add_argument('--file', help='The output file name', metavar='docker-compose.yml', default='docker-compose.yml')
parser.add_argument('--no-front', dest='no_front', help='Do not use a front container', action='store_true')
parser.add_argument('--no-api', dest='no_api', help='Do not use an api container', action='store_true')
parser.add_argument('--no-db', dest='no_db', help='Do not use a db container', action='store_true')
parser.add_argument('--no-db-admin', dest='no_db_admin', help='Do not use a db configuration container', action='store_true')
parser.add_argument('--api', help='The image to use for an api', metavar='phalcon')
parser.add_argument('--front', help='The image to use for an api', metavar='angular')
parser.add_argument('--db', help='The image to use for an api', metavar='postgres')
parser.add_argument('--db-admin', help='The image to use for an api', metavar='phppgadmin')
args = parser.parse_args()

defined_port = int(args.port)
defined_base_container_name = args.name + "-"
document = "version: '" + str(default_compose_version) + "'\n\nservices:\n"
default_networks = "networks:\n  net:"


def check_images(args):
    if args.api is not None:
        api_configuration['image'] = images_available['api'][args.api]
    if args.front is not None:
{'fraction_non_alphanumeric': 0.19002822201317027, 'fraction_numerical': 0.006450745867490929, 'mean_word_length': 3.496676737160121, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6364786', 'n_tokens_mistral': 2380, 'n_tokens_neox': 2296, 'n_words': 500}