From df52b4151963457f21698814e9fba542d0c85aae Mon Sep 17 00:00:00 2001
From: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com>
Date: Mon, 30 Sep 2019 13:17:54 +0200
Subject: [PATCH] Fixed up docker so it works with the merged in changes.

---
 Dockerfile       | 9 +++++++--
 README.rdoc      | 3 ++-
 bin/aethyr_setup | 6 +++---
 conf/config.yaml | 2 +-
 4 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index a6b685d..d235bb5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,13 +2,18 @@ FROM ruby:2.6
 
 # throw errors if Gemfile has been modified since Gemfile.lock
 RUN bundle config --global frozen 1
+RUN gem install bundler
 
 WORKDIR /usr/src/app
 
-#COPY Gemfile Gemfile.lock ./
 COPY . .
+RUN rm -rf storage && rm -rf lib/aethyr/extensions/reactions
 
 RUN bundle install
+#RUN bundle update --bundler
+
+#cleanup
+RUN rm -rf .git
 
 EXPOSE 8888
-CMD ["/usr/local/bin/bundle", "exec", "/usr/src/app/bin/aethyr", "run"]
+CMD ["bundle", "exec", "./bin/aethyr", "run"]
diff --git a/README.rdoc b/README.rdoc
index 6a0d910..11916d0 100644
--- a/README.rdoc
+++ b/README.rdoc
@@ -34,4 +34,5 @@ Just run the application with the following command.
 == Using Docker
  
     docker build -t syncleus/aethyr .
-    docker run -p 8888:8888 --rm syncleus/aethyr
+    docker run --rm -i -v "$PWD/storage:/usr/src/app/storage" -v "$PWD/conf:/usr/src/app/conf" -v "$PWD/lib/aethyr/extensions/reactions:/usr/src/app/lib/aethyr/extensions/reactions" -t syncleus/aethyr bundle exec ./bin/aethyr_setup
+    docker run -p 8888:8888 -v "$PWD/storage:/usr/src/app/storage" -v "$PWD/conf:/usr/src/app/conf" -v "$PWD/lib/aethyr/extensions/reactions:/usr/src/app/lib/aethyr/extensions/reactions" --rm syncleus/aethyr
diff --git a/bin/aethyr_setup b/bin/aethyr_setup
index 45871a7..f014170 100755
--- a/bin/aethyr_setup
+++ b/bin/aethyr_setup
@@ -87,8 +87,8 @@ def reset_storage
   end
 
   puts "Erasing storage..."
-  FileUtils.rm_rf "storage/", :secure => true
-  FileUtils.mkdir "storage"
+  FileUtils.mkdir "storage"  if not File.exist? "storage/"
+  FileUtils.rm_rf Dir.glob("storage/*"), :secure => true
   FileUtils.mkdir "storage/boards"
   FileUtils.mkdir "storage/admin"
   FileUtils.mkdir "logs" if not File.exist? "logs/"
@@ -131,7 +131,7 @@ def reset_storage
 
   puts "Adding helper reactions..."
 
-  FileUtils.mkdir "lib/aethyr/extensions/reactions" if not File.exist? "lib/aethyr/objects/reactions/"
+  FileUtils.mkdir "lib/aethyr/extensions/reactions" if not File.exist? "lib/aethyr/extensions/reactions/"
 
   File.open "lib/aethyr/extensions/reactions/helper.rx", "w" do |f|
     f.write helper_reactions
diff --git a/conf/config.yaml b/conf/config.yaml
index 4db075a..7cce32b 100644
--- a/conf/config.yaml
+++ b/conf/config.yaml
@@ -9,7 +9,7 @@
 :restart_delay: 10
 :address: 0.0.0.0
 :intro_file: intro.txt
-:start_room: 2197cd6f-523e-0922-6722-fe97b729677c
+:start_room: 925f8042-915a-9582-2d07-059473ae02f7
 :restart_limit: 15
 :mccp: false
 :mssp: false
-- 
GitLab