From 97e2a614c8587bbd9535ed28dc1bcf766751b2cc Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 13 Dec 2016 09:05:45 +1100 Subject: [PATCH] add wrappers for mailcatcher and sidekiq add symlink to simplify invoking docker commands `d/rake` --- bin/docker/boot_dev | 2 +- bin/docker/mailcatcher | 4 ++++ bin/docker/sidekiq | 5 +++++ d | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100755 bin/docker/mailcatcher create mode 100755 bin/docker/sidekiq create mode 120000 d diff --git a/bin/docker/boot_dev b/bin/docker/boot_dev index fcd1b3dd34d..be31b320fd6 100755 --- a/bin/docker/boot_dev +++ b/bin/docker/boot_dev @@ -36,7 +36,7 @@ echo "Using data in: ${DATA_DIR}" mkdir -p "${DATA_DIR}" -docker run -d -p 3000:3000 -v $DATA_DIR:/shared/postgres_data -v $SOURCE_DIR:/src --hostname=discourse --name=discourse_dev --restart=always discourse/discourse_dev:latest /sbin/boot +docker run -d -p 1080:1080 -p 3000:3000 -v $DATA_DIR:/shared/postgres_data -v $SOURCE_DIR:/src --hostname=discourse --name=discourse_dev --restart=always discourse/discourse_dev:latest /sbin/boot if [ "${initialize}" = "initialize" ]; then echo "Installing gems..." diff --git a/bin/docker/mailcatcher b/bin/docker/mailcatcher new file mode 100755 index 00000000000..e25dc7c3642 --- /dev/null +++ b/bin/docker/mailcatcher @@ -0,0 +1,4 @@ +#!/bin/bash + +CMD="mailcatcher --http-ip 0.0.0.0 -f || (apt-get install -y libsqlite3-dev && gem install mailcatcher && mailcatcher --http-ip 0.0.0.0 -f)" +docker exec -it discourse_dev /bin/bash -c "$CMD" diff --git a/bin/docker/sidekiq b/bin/docker/sidekiq new file mode 100755 index 00000000000..ba39edb531c --- /dev/null +++ b/bin/docker/sidekiq @@ -0,0 +1,5 @@ +#!/bin/bash + +PARAMS="$@" +CMD="cd /src && RAILS_ENV=${RAILS_ENV:=development} bundle exec sidekiq -q critical,low,default" +docker exec -it -u discourse:discourse discourse_dev /bin/bash -c "$CMD" diff --git a/d b/d new file mode 120000 index 00000000000..83fa653519b --- /dev/null +++ b/d @@ -0,0 +1 @@ +bin/docker \ No newline at end of file