Created
July 20, 2020 08:05
-
-
Save vladzloteanu/a7b4fe349c2852226667bc501df56574 to your computer and use it in GitHub Desktop.
docker4lead
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DockerFile | |
FROM php:5.6-cli | |
# Install Composer | |
COPY --from=composer /usr/bin/composer /usr/bin/composer | |
#RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | |
RUN apt-get -qq update && apt-get -qq install mysql-client python3 libxml++2.6-dev > /dev/null | |
RUN docker-php-ext-configure bcmath | |
RUN docker-php-ext-install bcmath | |
RUN docker-php-ext-enable bcmath | |
RUN docker-php-ext-configure mbstring | |
RUN docker-php-ext-install mbstring | |
RUN docker-php-ext-enable mbstring | |
RUN docker-php-ext-configure pdo_mysql | |
RUN docker-php-ext-install pdo_mysql | |
RUN docker-php-ext-enable pdo_mysql | |
RUN docker-php-ext-configure soap | |
RUN docker-php-ext-install soap | |
RUN docker-php-ext-enable soap | |
RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli | |
WORKDIR /usr/src/myapp/ | |
RUN ls | |
RUN apt-get install -qq net-tools iputils-ping | |
#RUN bash "/usr/src/myapp/scripts/test/recreate_test_db.py" | |
#RUN ls ./ | |
#RUN pwd | |
#RUN ls "/usr/src/myapp/scripts/test/recreate_test_db.py" | |
# Setup project | |
#RUN composer install --no-interaction | |
CMD [ "./vendor/bin/phpunit", "test/domain/model/LeadStatisticModelTest", "--stop-on-failure" ] | |
#CMD [ "bash" ] | |
# Makefile | |
MAKEFILE_DIR=$(shell pwd) | |
LEAD_DIR="$(MAKEFILE_DIR)/../lead" | |
all: ## This help | |
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort | |
run-tests: ## run tests locally | |
docker build --tag dolead_lead:1.0 . | |
docker run -it \ | |
--mount src="$(LEAD_DIR)",target=/usr/src/myapp,type=bind \ | |
--network host \ | |
dolead_lead:1.0 | |
# config.test.json | |
{ | |
"stats_backend": "memory", | |
"environment": "test", | |
"twilio": { | |
"sid": "xx", | |
"secret": "xx", | |
"account_sid": "xx", | |
"auth_token": "xx" | |
}, | |
"exceptional.io":{ | |
"secret_key":"fe58d6fc388c799147a879c165f7d13b0e73ede6" | |
}, | |
"database":{ | |
"lead":{ | |
"host":"host.docker.internal", | |
"database":"lead_test", | |
"username":"root", | |
"password":"root" | |
}, | |
"queue_api":{ | |
"host":"host.docker.internal", | |
"database":"queue_api_test", | |
"username":"root", | |
"password":"root" | |
}, | |
"queue_api_restore":{ | |
"host":"host.docker.internal", | |
"database":"queue_api_test", | |
"username":"root", | |
"password":"root" | |
}, | |
"cache": { | |
"host": "host.docker.internal", | |
"db": "0", | |
"scheme": "tcp", | |
"port": "6379" | |
} | |
}, | |
"rest":{ | |
"campaign_lead_update":"http://campaign.local/lead/save", | |
"dolead_track":"http://campaign.local/lead/dolead_track", | |
"form_template":"http://dolead.local/rest/sitetemplate/get/", | |
"get_site_id":"http://campaign.local/lead/get_site_id", | |
"dcm_api":{"domain": "http://localhost:8082/v1", "api_key": "4E45645D6DF2FCD8"}, | |
"lead_procuration_custom": { | |
"api_key": "1234abcd" | |
} | |
}, | |
"url":{ | |
"campaign":"http://campaign.local", | |
"idcontent":"http://idcontent.local", | |
"lead":"http://lead.local", | |
"resources":"http://resources.local" | |
}, | |
"path":{ | |
"log_root": "/var/log/dolead/lead/", | |
"webservice_log":"/var/log/dolead/lead/webservice.log", | |
"procuration_log":"/var/log/dolead/lead/procuration/", | |
"customer_log":"/var/log/dolead/lead/customer/", | |
"procuration_callback_log":"/var/log/dolead/lead/procuration_callback/" | |
}, | |
"redirection":{ | |
"percentage_redirection": 30, | |
"dolead_webservice": "http://dolead.local/webservices/partner?" | |
}, | |
"provider_callback":{ | |
"sem_dolead":{ | |
"user":"tradingdesk", | |
"password":"toto" | |
}, | |
"sem_display":{ | |
"user":"tradingdesk", | |
"password":"tata" | |
}, | |
"google_search_allemagne":{ | |
"user":"google_search_allemagne", | |
"password":"599b9ff7da1cd7f0bf7cdd9fde57379e1f18d174" | |
} | |
}, | |
"celery": { | |
"stats": { | |
"host": "localhost", | |
"user": "guest", | |
"password": "guest", | |
"vhost": "/", | |
"exchange": "stats", | |
"binding": "stats", | |
"port": 5672 | |
} | |
}, | |
"event_log": { | |
"transport": "direct" | |
}, | |
"keyring":{ | |
"display":{ | |
"user":"lead", | |
"key":"fae7puoqui2Ie" | |
} | |
}, | |
"plugman": { | |
"executor": "cd /Users/vlad/wrk/dolead/plugman/src && ./venv/bin/python api.py {}" | |
}, | |
"segment_io": { | |
"write_key": "ULybwJISKTOuNuo9Ir6Ex8gdZe8lGNGj" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment