Merge pull request #173 from infosiftr/docker-compose
Add some official docker-compose.yml scaffolding
This commit is contained in:
commit
34d41140ce
|
|
@ -0,0 +1,5 @@
|
|||
... via [`docker-compose`](https://github.com/docker/compose)
|
||||
|
||||
Example `docker-compose.yml` for `%%REPO%%`:
|
||||
|
||||
%%COMPOSE-YML%%
|
||||
13
update.sh
13
update.sh
|
|
@ -93,6 +93,13 @@ for repo in "${repos[@]}"; do
|
|||
logo=""
|
||||
fi
|
||||
|
||||
compose=
|
||||
composeYml=
|
||||
if [ -f "$repo/docker-compose.yml" ]; then
|
||||
compose="$(cat "$repo/compose.md" 2>/dev/null || cat "$helperDir/compose.md")"
|
||||
composeYml="$(sed 's/^/\t/' "$repo/docker-compose.yml")"
|
||||
fi
|
||||
|
||||
cp -v "$helperDir/template.md" "$repo/README.md"
|
||||
|
||||
echo ' TAGS => generate-dockerfile-links-partial.sh'
|
||||
|
|
@ -105,6 +112,12 @@ for repo in "${repos[@]}"; do
|
|||
echo " LOGO => $logo"
|
||||
replace_field "$repo" 'LOGO' "$logo" '\s*'
|
||||
|
||||
echo ' COMPOSE => '"$repo"'/compose.md'
|
||||
replace_field "$repo" 'COMPOSE' "$compose"
|
||||
|
||||
echo ' COMPOSE-YML => '"$repo"'/docker-compose.yml'
|
||||
replace_field "$repo" 'COMPOSE-YML' "$composeYml"
|
||||
|
||||
echo ' DOCKER-VERSIONS => '"$repo"'/docker-versions.md'
|
||||
replace_field "$repo" 'DOCKER-VERSIONS' "$dockerVersions"
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,24 @@ If you'd like to use an external database instead of a linked `mysql` container,
|
|||
docker run --name some-wordpress -e WORDPRESS_DB_HOST=10.1.2.3:3306 \
|
||||
-e WORDPRESS_DB_USER=... -e WORDPRESS_DB_PASSWORD=... -d wordpress
|
||||
|
||||
## ... via [`docker-compose`](https://github.com/docker/compose)
|
||||
|
||||
Example `docker-compose.yml` for `wordpress`:
|
||||
|
||||
wordpress:
|
||||
image: wordpress
|
||||
links:
|
||||
- db:mysql
|
||||
ports:
|
||||
- 8080:80
|
||||
|
||||
db:
|
||||
image: mariadb
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: example
|
||||
|
||||
Run `docker-compose up`, wait for it to initialize completely, and visit `http://localhost:8080` or `http://host-ip:8080`.
|
||||
|
||||
# Supported Docker versions
|
||||
|
||||
This image is officially supported on Docker version 1.5.0.
|
||||
|
|
|
|||
|
|
@ -30,3 +30,7 @@ If you'd like to use an external database instead of a linked `mysql` container,
|
|||
|
||||
docker run --name some-wordpress -e WORDPRESS_DB_HOST=10.1.2.3:3306 \
|
||||
-e WORDPRESS_DB_USER=... -e WORDPRESS_DB_PASSWORD=... -d wordpress
|
||||
|
||||
## %%COMPOSE%%
|
||||
|
||||
Run `docker-compose up`, wait for it to initialize completely, and visit `http://localhost:8080` or `http://host-ip:8080`.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
wordpress:
|
||||
image: wordpress
|
||||
links:
|
||||
- db:mysql
|
||||
ports:
|
||||
- 8080:80
|
||||
|
||||
db:
|
||||
image: mariadb
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: example
|
||||
Loading…
Reference in New Issue