diff options
Diffstat (limited to 'examples/example6')
-rw-r--r-- | examples/example6/docker-compose.yml | 23 | ||||
-rwxr-xr-x | examples/example6/example6.sh | 18 |
2 files changed, 41 insertions, 0 deletions
diff --git a/examples/example6/docker-compose.yml b/examples/example6/docker-compose.yml new file mode 100644 index 0000000..082697c --- /dev/null +++ b/examples/example6/docker-compose.yml @@ -0,0 +1,23 @@ +version: '3.1' + +services: + + wordpress: + image: wordpress + restart: always + ports: + - 8000:80 + environment: + WORDPRESS_DB_HOST: db + WORDPRESS_DB_USER: exampleuser + WORDPRESS_DB_PASSWORD: examplepass + WORDPRESS_DB_NAME: exampledb + + db: + image: mysql:5.7 + restart: always + environment: + MYSQL_DATABASE: exampledb + MYSQL_USER: exampleuser + MYSQL_PASSWORD: examplepass + MYSQL_RANDOM_ROOT_PASSWORD: '1' diff --git a/examples/example6/example6.sh b/examples/example6/example6.sh new file mode 100755 index 0000000..9078da1 --- /dev/null +++ b/examples/example6/example6.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# vim: set filetype=sh +# +# Author: Cody Hiar +# Date: 2019-01-15 +# +# Description: run docker-compose command +# +# Set options: +# e: Stop script if command fails +# u: Stop script if unset variable is referenced +# x: Debug, print commands as they are executed +# o pipefail: If any command in a pipeline fails it all fails +# +set -exuo pipefail + +# Run the compose file +docker-compose up |