Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/linters/.hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ignored:
- DL3022
- DL3008
- DL3059
- DL4006
12 changes: 12 additions & 0 deletions .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Hard wrap to 120, not 80
MD013:
line_length: 120

# Allow no new lines between h1 tags (Changelog)
MD022: false

# Allow multiple h1 tags (Changelog)
MD025: false

# Allow no new lines between lists (Changelog)
MD032: false
20 changes: 20 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Lint Code Base
on: push

jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Lint Code Base
uses: github/super-linter/slim@v4
env:
VALIDATE_ALL_CODEBASE: true
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 18 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# v1.3.0 (November 9, 2020)
* Retire non `st-internal` network names (not yet removed).
* Remove outdated python and upsource documentation.
* Move yii2-shell docs into /docs
* Add `./scripts/db_migrate` for moving databases between versions of database.
* Update docker templates for latest php74 packages/versions.
* Retire non `st-internal` network names (not yet removed).
* Remove outdated python and upsource documentation.
* Move yii2-shell docs into /docs
* Add `./scripts/db_migrate` for moving databases between versions of database.
* Update docker templates for latest php74 packages/versions.

# v1.2.1 (June 9, 2020)
* Added PostgreSQL v9.4
* Added PostgreSQL v9.4

# v1.2.0 (March 6, 2020)
* Removed mysql56
* Deprecated networks that aren't "st-internal"
* Added MariaDB10.3
* Added MariaDB10.4
* Added optional phpMyAdmin
* Removed mysql56
* Deprecated networks that aren't "st-internal"
* Added MariaDB10.3
* Added MariaDB10.4
* Added optional phpMyAdmin

# v1.1.1 (August 16, 2019)
* Removed d4m guide.
* Updated Laravel docker container to Node10 (previously Node8)
* Updated Yii2/Laravel scripts to leverage "st-internal" network
* Removed all unchanged php.ini files for both Yii2/Laravel
* Removed d4m guide.
* Updated Laravel docker container to Node10 (previously Node8)
* Updated Yii2/Laravel scripts to leverage "st-internal" network
* Removed all unchanged php.ini files for both Yii2/Laravel

# v1.1.0 (Oct 1, 2018)
* [Breaking] Removed MariaDB10.1
* Added MariaDB10.2
* [Breaking] Removed MariaDB10.1
* Added MariaDB10.2

# v1.0.0 (July 5, 2018)
* Initial release
* Initial release
48 changes: 26 additions & 22 deletions DOCKER_TIPS.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
# Docker Tips

## Typical Docker Commands
### Start all environments services
> docker-compose up --build

### Restart a specific container
> docker restart [service name]
```bash
# Start all environments services
docker-compose up --build

### List all containers
> docker ps -a
# Restart a specific container
docker restart [service name]

### List running containers
> docker ps
# List all containers
docker ps -a

### See used space
> docker system df
# List running containers
docker ps

### Remove un-used data
> docker system prune
# See used space
docker system df

## Passwords
### PostgreSQL
> username: postgres_user
> password: postgres_pass
# Remove un-used data
docker system prune
```

### MariaDB
> username: mariadb_user
> password: mariadb_pass
## Passwords

* PostgreSQL
* `username: postgres_user`
* `password: postgres_pass`
* MariaDB
* `username: mariadb_user`
* `password: mariadb_pass`

## Running Xdebug with PHPStorm alongside Docker.
## 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.

Old logic (that has not updated to special DNS name) will need to point to the IP of `10.254.254.254`.
* Old logic (that has not updated to special DNS name) will need to point to the IP of `10.254.254.254`.

```
```bash
sudo ifconfig lo0 alias 10.254.254.254
```
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Sourcetoad Internal Development Tools (SIDT)

[![GitHub Super-Linter](https://github.com/sourcetoad/DevopsToolKit/workflows/Lint%20Code%20Base/badge.svg)](https://github.com/marketplace/actions/super-linter)

Sourcetoad Internal Development Tools includes a growing collection of tutorials
for managing IDEs, hooking up tools with Docker and any combination of those
things.
Expand All @@ -25,9 +27,9 @@ cd ./devop-tools/docker/data-source-services && docker-compose up --build -d
```

#### Specific Setup - Windows
* Kill, and optionally disable, the `World Wide Web Publishing Service`
* Run `set COMPOSE_CONVERT_WINDOWS_PATHS=1` in your CMD or PowerShell terminal
* Optionally, [read](https://github.com/docker/compose/issues/4303#issuecomment-379563170) this bug report.
* Kill, and optionally disable, the `World Wide Web Publishing Service`
* Run `set COMPOSE_CONVERT_WINDOWS_PATHS=1` in your CMD or PowerShell terminal
* Optionally, [read](https://github.com/docker/compose/issues/4303#issuecomment-379563170) this bug report.

### Optional: Data Source Tools
* Optionally included is the following tools:
Expand All @@ -36,11 +38,11 @@ cd ./devop-tools/docker/data-source-services && docker-compose up --build -d

## phpMyAdmin
If the optional tools are launched, you can find phpMyAdmin at: localhost:8080
* It supports the following databases...
* mariadb102 (deprecated)
* mariadb103
* mariadb104
* mariadb105
* It supports the following databases...
* mariadb102 (deprecated)
* mariadb103
* mariadb104
* mariadb105

## Examples
Inside the `examples` folder you will find example Docker configurations for
Expand All @@ -52,9 +54,9 @@ already added to the `/etc/hosts` file. You can edit to add `127.0.0.1 domain.do
## Scripts
Inside the `scripts` folder you will find one-off scripts to help with tasks.

* `db_migrate.sh` - Helps migrate databases between versions of mysql.
* `db_migrate.sh` - Helps migrate databases between versions of mysql.

## Docs
* [Setting up Nginx-Proxy](docs/nginx-proxy/README.md)
* [Setting up PHP Testing in PHPStorm](docs/phpstorm-docker/README.md)
* [Leveraging Yii2 Shell](docs/yii2/yii-shell.md)
* [Setting up Nginx-Proxy](docs/nginx-proxy/README.md)
* [Setting up PHP Testing in PHPStorm](docs/phpstorm-docker/README.md)
* [Leveraging Yii2 Shell](docs/yii2/yii-shell.md)
3 changes: 2 additions & 1 deletion docker/data-source-services/network-creation.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
echo "Creating container networks:\n"
#!/usr/bin/env bash
echo "Creating container networks:"
docker network create st-internal
23 changes: 14 additions & 9 deletions docs/nginx-proxy/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
# nginx-proxy

The data source services includes an application called nginx-proxy. This allows you to run multiple projects at the same time on different virtual hosts without port conflicts. You do not need to expose the webserver to the host machine through a port map.
The data source services includes an application called nginx-proxy. This allows you to run multiple projects at the
same time on different virtual hosts without port conflicts. You do not need to expose the webserver to the host machine
through a port map.

In order for nginx-proxy to operate, you must follow the following steps.

## Setup hosts file
1. Choose a virtual host for your project. RFC-6761 recommends against using a .dev TLD, and instead using a .localhost TLD. Therefore, your domain might be mysite.localhost
2. Edit your hosts file and add this domain to your loopback address (127.0.0.1) using your preferred text editor. *make sure to use sudo*
```
1. Choose a virtual host for your project. RFC-6761 recommends against using a .dev TLD, and instead using a .localhost
TLD. Therefore, your domain might be mysite.localhost
2. Edit your hosts file and add this domain to your loopback address (127.0.0.1) using your preferred text editor.

```bash
sudo nano /etc/hosts

add:
127.0.0.1 mysite.localhost
```

## Setup docker-compose for project
1. In order for nginx-proxy to detect and proxy to the correct virtual host, you must first identify the container that is running the "web server." In a php project, this would be the nginx container, for example.
2. You will then add an environment variable of `VIRTUAL_HOST=mysite.localhost` to this service, place that service on the nginx-proxy network, and import that nginx-proxy network to the project. See the below snippet:
1. In order for nginx-proxy to detect and proxy to the correct virtual host, you must first identify the container that
is running the "web server." In a php project, this would be the nginx container, for example.
2. You will then add an environment variable of `VIRTUAL_HOST=mysite.localhost` to this service, place that service on
the nginx-proxy network, and import that nginx-proxy network to the project. See the below snippet:

```
```bash
version: '2'
services:
[APP_NAME]_nginx:
image: nginx:latest
environment:
- VIRTUAL_HOST=mysite.localhost
```
```
Loading