To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / extra / soundsoftware / dockertest / start.sh @ 1576:d1de6986e429
History | View | Annotate | Download (608 Bytes)
| 1 | 1569:26a4f99ec679 | Chris | #!/bin/bash |
|---|---|---|---|
| 2 | |||
| 3 | 1574:7b23adecd963 | Chris | dbpwd="$1" |
| 4 | if [ -z "$dbpwd" ]; then |
||
| 5 | echo "Usage: $0 <database-password>" 1>&2 |
||
| 6 | exit 2 |
||
| 7 | fi |
||
| 8 | |||
| 9 | 1569:26a4f99ec679 | Chris | set -eu |
| 10 | |||
| 11 | dockerdir=./extra/soundsoftware/dockertest |
||
| 12 | if [ ! -d "$dockerdir" ]; then |
||
| 13 | echo "Run this script from the root of a working copy of soundsoftware-site" |
||
| 14 | exit 2 |
||
| 15 | fi |
||
| 16 | |||
| 17 | 1574:7b23adecd963 | Chris | for f in database.yml code.conf ; do |
| 18 | cat "$dockerdir/$f" | |
||
| 19 | sed 's/INSERT_POSTGRES_PASSWORD_HERE/'"$dbpwd"'/g' > \ |
||
| 20 | "$dockerdir/$f.interpolated" |
||
| 21 | done |
||
| 22 | |||
| 23 | 1569:26a4f99ec679 | Chris | dockertag="cannam/soundsoftware-site" |
| 24 | |||
| 25 | sudo docker build -t "$dockertag" -f "$dockerdir/Dockerfile" . |
||
| 26 | 1571:4c2b25b7e85f | Chris | sudo docker run -p 8080:80 -d "$dockertag" |