diff --git a/Dockerfile b/Dockerfile index 77f9957..6b97261 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,8 @@ RUN apk add --no-cache \ yarn \ sqlite-dev \ bash \ - postgresql-dev + postgresql-dev \ + python2 WORKDIR /app @@ -31,7 +32,11 @@ VOLUME /app/db/database RUN yarn install --check-files; bundle exec rake assets:precompile +RUN apk del \ + git \ + python2 \ + build-base + EXPOSE 3000 -ENTRYPOINT ["/bin/bash"] -CMD ["/app/entrypoint.sh"] +CMD if [ -f /app/tmp/pids/server.pid ]; then rm -f /app/tmp/pids/server.pid; fi && cd /app && bundle exec rake 'db:migrate' && bundle exec rails server -b 0.0.0.0 diff --git a/config/database.yml b/config/database.yml index 0aa9a41..56175d6 100644 --- a/config/database.yml +++ b/config/database.yml @@ -2,4 +2,4 @@ production: adapter: sqlite3 pool: 5 timeout: 5000 - database: <%= ENV['DATABASE'] || "" %> \ No newline at end of file + database: <%= ENV['DATABASE'] || "db/database/snibox.sqlite3" %> \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100644 index 8d1e987..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -DATABASE=${DATABASE:-db/database/snibox.sqlite3} - -if [ -f /app/tmp/pids/server.pid ] -then - rm -f /app/tmp/pids/server.pid -fi - -cd /app - -if [ ! -f $DATABASE ] -then - rake 'db:migrate' -fi - -bundle exec rails server -b 0.0.0.0 \ No newline at end of file