From 39c5b9ae6317afc9ee246590a9fe7ebe985a9844 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Thu, 5 Mar 2020 09:26:46 -0500 Subject: [PATCH 01/12] docs: remove outdated mysql56 tips --- DOCKER_TIPS.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/DOCKER_TIPS.md b/DOCKER_TIPS.md index 690004f..a81b1b1 100644 --- a/DOCKER_TIPS.md +++ b/DOCKER_TIPS.md @@ -1,19 +1,19 @@ ## Typical Docker Commands ### Start all environments services > docker-compose up --build - + ### Restart a specific container > docker restart [service name] - + ### List all containers > docker ps -a - + ### List running containers > docker ps - + ### See used space > docker system df - + ### Remove un-used data > docker system prune @@ -21,11 +21,7 @@ ### PostgreSQL > username: postgres_user > password: postgres_pass - - ### MySql - > username: mysql_user - > password: mysql_pass - + ### MariaDB > username: mariadb_user > password: mariadb_pass @@ -33,10 +29,10 @@ ## Running Xdebug with PHPStorm alongside Docker. From Docker versions 18.03 and above, Docker creates a special DNS name that resolves -to the internal IP address used by the host. +to the internal IP address used by the host. Old logic (that has not updated to special DNS name) will need to point to the IP of `10.254.254.254`. ``` sudo ifconfig lo0 alias 10.254.254.254 -``` \ No newline at end of file +``` From 6ca2712434e04b8ca6e4e5bfae66abea714fe338 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Thu, 5 Mar 2020 09:27:11 -0500 Subject: [PATCH 02/12] docs: remove "st-mysql-56" and trailing space --- README.md | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index c08d688..d32e079 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ # Sourcetoad Internal Development Tools (SIDT) Sourcetoad Internal Development Tools includes a growing collection of tutorials -for managing IDEs, hooking up tools with Docker and any combination of those +for managing IDEs, hooking up tools with Docker and any combination of those things. -Additionally, this repository holds our data source services which is -a collection of databases and other services that projects will more than likely -need. It also provides a proxy setup via nginx-proxy so that multiple projects +Additionally, this repository holds our data source services which is +a collection of databases and other services that projects will more than likely +need. It also provides a proxy setup via nginx-proxy so that multiple projects can be run at the same time without the need for different ports. -This means docker configurations for each project only needs to worry about the +This means docker configurations for each project only needs to worry about the the language and other tools it may need, as the databases and other services are standardized in this project. Since most cloud providers provide managed versions of these services, you likely would not use a docker version of them in production. @@ -24,10 +24,9 @@ of these services, you likely would not use a docker version of them in producti - If this fails, then manual configuration is necessary before compilation. Perform the following: 1. `docker network create nginx-proxy` 2. `docker network create st-mariadb-102` - 3. `docker network create st-mysql-56` - 4. `docker network create st-postgres-95` - 5. `docker network create st-redis-32` - 6. `docker network create st-internal` + 3. `docker network create st-postgres-95` + 4. `docker network create st-redis-32` + 5. `docker network create st-internal` 5. Execute `docker-compose up --build` - If you're in a Windows environment, then perform the following if your build fails: 1. Kill, and optionally disable, the `World Wide Web Publishing Service`. @@ -40,7 +39,7 @@ of these services, you likely would not use a docker version of them in producti Inside the `examples` folder you will find example Docker configurations for popular frameworks like Laravel and Yii2. -The examples make the assumption that any domain used for local development is +The examples make the assumption that any domain used for local development is already added to the `/etc/hosts` file. You can edit to add `127.0.0.1 domain.docker`. ## Docs @@ -48,4 +47,3 @@ already added to the `/etc/hosts` file. You can edit to add `127.0.0.1 domain.do * [Setting up PHP Testing in PHPStorm](docs/phpstorm-docker/README.md) * [Setting up Python Debugging in Pycharm](docs/pycharm-debugging/README.md) * [Building a new Upsource Project](docs/upsource/README.md) - From 3c3c42e9d855d0b955e83f555f0c8bea45c16fbb Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Thu, 5 Mar 2020 09:27:28 -0500 Subject: [PATCH 03/12] build: drop mysql56, add maria103 --- .../data-source-services/docker-compose.yml | 20 +++++++++---------- .../data-source-services/network-creation.sh | 1 - 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/docker/data-source-services/docker-compose.yml b/docker/data-source-services/docker-compose.yml index 54422d1..4249f7b 100755 --- a/docker/data-source-services/docker-compose.yml +++ b/docker/data-source-services/docker-compose.yml @@ -32,17 +32,17 @@ services: -c log_filename='%Y-%m-%d.log' -c log_line_prefix='%t %v ' -c log_statement='all'" - mysql56: - image: mysql:5.6 - container_name: sourcetoad_mysql56 + mariadb103: + image: mariadb:10.3 + container_name: sourcetoad_mariadb103 ports: - - "3356:3306" + - "33103:3306" environment: - MYSQL_ROOT_PASSWORD=root - - MYSQL_USER=mysql_user - - MYSQL_PASSWORD=mysql_pass + - MYSQL_USER=mariadb_user + - MYSQL_PASSWORD=mariadb_pass networks: - - st-mysql-56 + - st-internal mariadb102: image: mariadb:10.2 container_name: sourcetoad_mariadb102 @@ -69,12 +69,12 @@ networks: st-postgres-95: external: name: st-postgres-95 - st-mysql-56: + st-internal: external: - name: st-mysql-56 + name: st-internal st-mariadb-102: external: name: st-mariadb-102 st-redis-32: external: - name: st-redis-32 \ No newline at end of file + name: st-redis-32 diff --git a/docker/data-source-services/network-creation.sh b/docker/data-source-services/network-creation.sh index 58a6c28..0cf2986 100755 --- a/docker/data-source-services/network-creation.sh +++ b/docker/data-source-services/network-creation.sh @@ -2,6 +2,5 @@ echo "Creating container networks:\n" docker network create st-internal docker network create nginx-proxy docker network create st-mariadb-102 -docker network create st-mysql-56 docker network create st-postgres-95 docker network create st-redis-32 From 6abe77d42c451052c7ba9ce7e1f5a6b24d14e36d Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Thu, 5 Mar 2020 09:44:56 -0500 Subject: [PATCH 04/12] feat: add optional data-source-tools to deprecate among each project --- docker/data-source-tools/docker-compose.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 docker/data-source-tools/docker-compose.yml diff --git a/docker/data-source-tools/docker-compose.yml b/docker/data-source-tools/docker-compose.yml new file mode 100644 index 0000000..18c0df6 --- /dev/null +++ b/docker/data-source-tools/docker-compose.yml @@ -0,0 +1,17 @@ +version: '2' +services: + phpmyadmin: + image: phpmyadmin/phpmyadmin:latest + container_name: sourcetoad_phpmyadmin + ports: + - 8080:80 + networks: + - st-internal + environment: + PMA_HOSTS: mariadb102,mariadb103 + PMA_USER: root + PMA_PASSWORD: root +networks: + st-internal: + external: + name: st-internal From e9c9314710f123af8d93ce319031827b9ae316f3 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Thu, 5 Mar 2020 09:46:05 -0500 Subject: [PATCH 05/12] docs: add optional notes about data source tools --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d32e079..ceb5210 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ of these services, you likely would not use a docker version of them in producti ## Docker -### devop-tools (data source services / domain tools) +### Required: data source services 1. Execute `git clone git@github.com:sourcetoad/DevopsToolKit.git devop-tools` 2. `cd devop-tools` 3. `cd ./docker/data-source-services/` @@ -35,6 +35,21 @@ of these services, you likely would not use a docker version of them in producti 6. Wait for the terminal to complete executing. 7. You now have Sourcetoad data sources running and logging to the console. +### Optional: data source tools +1. Optionally included is the following tools: + * phpMyAdmin +2. `cd devop-tools` +3. `cd ./docker/data-source-tools/` +4. Execute `docker-compose up --build` +5. Wait for the terminal to complete executing. +6. You know have Sourcetoad data source tools running. + +## phpMyAdmin +If the optional tools are launched, you can find phpMyAdmin at: localhost:8080 + * It supports the following databases... + * mariadb102 + * mariadb103 + ## Examples Inside the `examples` folder you will find example Docker configurations for popular frameworks like Laravel and Yii2. From d4c597756aaaf85cd3ca78bc16698d9aacfaeeb0 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Thu, 5 Mar 2020 09:46:23 -0500 Subject: [PATCH 06/12] build: add "st-internal" to all networks to begin deprecation --- docker/data-source-services/docker-compose.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker/data-source-services/docker-compose.yml b/docker/data-source-services/docker-compose.yml index 4249f7b..aa95eca 100755 --- a/docker/data-source-services/docker-compose.yml +++ b/docker/data-source-services/docker-compose.yml @@ -16,6 +16,7 @@ services: - ./proxy_increase.conf:/etc/nginx/proxy.conf networks: - nginx-proxy + - st-internal postgres95: image: postgres:9.5 container_name: sourcetoad_postgres95 @@ -26,6 +27,7 @@ services: - POSTGRES_PASSWORD=postgres_pass networks: - st-postgres-95 + - st-internal command: "postgres -c logging_collector='on' -c log_directory='/var/log/postgresql' @@ -54,6 +56,7 @@ services: - MYSQL_PASSWORD=mariadb_pass networks: - st-mariadb-102 + - st-internal redis32: image: redis:3.2-alpine command: redis-server --appendonly yes @@ -62,6 +65,7 @@ services: - "6332:6379" networks: - st-redis-32 + - st-internal networks: nginx-proxy: external: From bb5017c50deb9a54511aa469c2b3a253178641d6 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Thu, 5 Mar 2020 09:56:41 -0500 Subject: [PATCH 07/12] build: drop dead networks --- docker/data-source-services/network-creation.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docker/data-source-services/network-creation.sh b/docker/data-source-services/network-creation.sh index 0cf2986..9664368 100755 --- a/docker/data-source-services/network-creation.sh +++ b/docker/data-source-services/network-creation.sh @@ -1,6 +1,2 @@ echo "Creating container networks:\n" docker network create st-internal -docker network create nginx-proxy -docker network create st-mariadb-102 -docker network create st-postgres-95 -docker network create st-redis-32 From efe5aa3f72b5c1922c912978481b44a992bac84e Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Thu, 5 Mar 2020 09:56:58 -0500 Subject: [PATCH 08/12] build: add mariadb104 into phpmyadmin --- docker/data-source-tools/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/data-source-tools/docker-compose.yml b/docker/data-source-tools/docker-compose.yml index 18c0df6..9f70557 100644 --- a/docker/data-source-tools/docker-compose.yml +++ b/docker/data-source-tools/docker-compose.yml @@ -8,7 +8,7 @@ services: networks: - st-internal environment: - PMA_HOSTS: mariadb102,mariadb103 + PMA_HOSTS: mariadb102,mariadb103,mariadb104 PMA_USER: root PMA_PASSWORD: root networks: From 8be678d1d7fa60a413e03ca633249f595a5faa31 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Thu, 5 Mar 2020 09:57:08 -0500 Subject: [PATCH 09/12] feat: add maria104 (opt-in) --- docker/data-source-services/docker-compose.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docker/data-source-services/docker-compose.yml b/docker/data-source-services/docker-compose.yml index aa95eca..4785c83 100755 --- a/docker/data-source-services/docker-compose.yml +++ b/docker/data-source-services/docker-compose.yml @@ -34,6 +34,17 @@ services: -c log_filename='%Y-%m-%d.log' -c log_line_prefix='%t %v ' -c log_statement='all'" + mariadb104: + image: mariadb:10.4 + container_name: sourcetoad_mariadb104 + ports: + - "33104:3306" + environment: + - MYSQL_ROOT_PASSWORD=root + - MYSQL_USER=mariadb_user + - MYSQL_PASSWORD=mariadb_pass + networks: + - st-internal mariadb103: image: mariadb:10.3 container_name: sourcetoad_mariadb103 From 8cb9b369c1acc4ab1c325d2dfa2fb95f7b999a16 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Thu, 5 Mar 2020 09:58:58 -0500 Subject: [PATCH 10/12] fix: update example (Laravel/Yii2) into future --- examples/laravel5/Dockerfile | 6 +++--- examples/laravel5/docker-compose.yml | 14 +------------- examples/yii2/Dockerfile | 4 ++-- examples/yii2/docker-compose.yml | 15 +-------------- 4 files changed, 7 insertions(+), 32 deletions(-) diff --git a/examples/laravel5/Dockerfile b/examples/laravel5/Dockerfile index 7ea8cd4..5646e6c 100644 --- a/examples/laravel5/Dockerfile +++ b/examples/laravel5/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.2-fpm-stretch +FROM php:7.4 # System dependencies needed RUN apt-get update && apt-get install -y \ @@ -58,6 +58,6 @@ RUN sed -i -e "s/pm.max_spare_servers\s*=\s*[0-9]*/pm.max_spare_servers = 10/g" RUN sed -i -e "s/;pm.max_requests\s*=\s*[0-9]*/pm.max_requests = 500/g" /usr/local/etc/php-fpm.d/www.conf RUN sed -i -e "s/access.log/;access.log/g" /usr/local/etc/php-fpm.d/docker.conf -# Expose PHP and execute php-fpm +# Expose PHP and execute php-fpm EXPOSE 9000 -CMD ["php-fpm"] \ No newline at end of file +CMD ["php-fpm"] diff --git a/examples/laravel5/docker-compose.yml b/examples/laravel5/docker-compose.yml index 537382d..4df0fa4 100644 --- a/examples/laravel5/docker-compose.yml +++ b/examples/laravel5/docker-compose.yml @@ -14,7 +14,6 @@ services: - ./config/vhost.conf:/etc/nginx/conf.d/vhost.conf networks: - st-internal - - nginx-proxy # PHP Container # The environment variables allow Xdebug to work properly. # Networks much like above can be registered depending on what the application @@ -29,20 +28,9 @@ services: - ../:/code networks: - st-internal - - st-mariadb-102 # These are networks that you are leveraging from outside (external) locations. -# The dev-ops repo is already running, so these networks already exist. We tell -# docker which networks of the dev-ops repo we need. +# The dev-ops repo is already running, so that network (st-internal) exists. networks: st-internal: external: name: st-internal - nginx-proxy: - external: - name: nginx-proxy - st-redis-32: - external: - name: st-redis-32 - st-mariadb-102: - external: - name: st-mariadb-102 \ No newline at end of file diff --git a/examples/yii2/Dockerfile b/examples/yii2/Dockerfile index 1d81b8a..1a7b0d8 100644 --- a/examples/yii2/Dockerfile +++ b/examples/yii2/Dockerfile @@ -1,5 +1,5 @@ FROM php:7.0-fpm - + # System dependencies needed RUN apt-get update && apt-get install -y \ git \ @@ -44,6 +44,6 @@ RUN sed -i -e "s/;pm.max_requests\s*=\s*[0-9]*/pm.max_requests = 500/g" /usr/loc RUN sed -i -e "s/access.log/;access.log/g" /usr/local/etc/php-fpm.d/docker.conf RUN sed -i -e "s/^error_log.*/error_log = \/proc\/self\/fd\/2/" /usr/local/etc/php-fpm.d/www.conf -# Expose PHP and execute php-fpm +# Expose PHP and execute php-fpm EXPOSE 9000 CMD ["php-fpm"] diff --git a/examples/yii2/docker-compose.yml b/examples/yii2/docker-compose.yml index 350aa0e..1d4a43a 100644 --- a/examples/yii2/docker-compose.yml +++ b/examples/yii2/docker-compose.yml @@ -14,7 +14,6 @@ services: - ./config/vhost.conf:/etc/nginx/conf.d/vhost.conf networks: - st-internal - - nginx-proxy # PHP Container # The environment variables allow Xdebug to work properly. # Networks much like above can be registered depending on what the application @@ -29,21 +28,9 @@ services: - ../:/code networks: - st-internal - - st-mariadb-102 - - st-redis-32 # These are networks that you are leveraging from outside (external) locations. -# The dev-ops repo is already running, so these networks already exist. We tell -# docker which networks of the dev-ops repo we need. +# The dev-ops repo is already running, so that network (st-internal) exists. networks: st-internal: external: name: st-internal - nginx-proxy: - external: - name: nginx-proxy - st-redis-32: - external: - name: st-redis-32 - st-mariadb-102: - external: - name: st-mariadb-102 \ No newline at end of file From e7b259d11e6e6d04765337d7a94f520511daf20b Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Thu, 5 Mar 2020 10:19:17 -0500 Subject: [PATCH 11/12] fix: rename "laravel5" to "laravel" to reflect Laravel --- examples/{laravel5 => laravel}/Dockerfile | 0 examples/{laravel5 => laravel}/config/php.ini | 0 examples/{laravel5 => laravel}/config/vhost.conf | 0 examples/{laravel5 => laravel}/docker-compose.yml | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename examples/{laravel5 => laravel}/Dockerfile (100%) rename examples/{laravel5 => laravel}/config/php.ini (100%) rename examples/{laravel5 => laravel}/config/vhost.conf (100%) rename examples/{laravel5 => laravel}/docker-compose.yml (100%) diff --git a/examples/laravel5/Dockerfile b/examples/laravel/Dockerfile similarity index 100% rename from examples/laravel5/Dockerfile rename to examples/laravel/Dockerfile diff --git a/examples/laravel5/config/php.ini b/examples/laravel/config/php.ini similarity index 100% rename from examples/laravel5/config/php.ini rename to examples/laravel/config/php.ini diff --git a/examples/laravel5/config/vhost.conf b/examples/laravel/config/vhost.conf similarity index 100% rename from examples/laravel5/config/vhost.conf rename to examples/laravel/config/vhost.conf diff --git a/examples/laravel5/docker-compose.yml b/examples/laravel/docker-compose.yml similarity index 100% rename from examples/laravel5/docker-compose.yml rename to examples/laravel/docker-compose.yml From 2632bfa09eb670219b74b45a6391e9a976dbc94a Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Thu, 5 Mar 2020 12:11:07 -0500 Subject: [PATCH 12/12] docs: fix spelling --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ceb5210..b030a20 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ of these services, you likely would not use a docker version of them in producti 3. `cd ./docker/data-source-tools/` 4. Execute `docker-compose up --build` 5. Wait for the terminal to complete executing. -6. You know have Sourcetoad data source tools running. +6. You now have Sourcetoad data source tools running. ## phpMyAdmin If the optional tools are launched, you can find phpMyAdmin at: localhost:8080