Added dedicated entrypoint
This commit is contained in:
@@ -33,4 +33,5 @@ RUN yarn install --check-files; bundle exec rake assets:precompile
|
|||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
CMD cd /app && rake 'db:migrate' && bundle exec rails server -b 0.0.0.0
|
ENTRYPOINT ["/bin/bash"]
|
||||||
|
CMD ["/app/entrypoint.sh"]
|
||||||
|
|||||||
17
entrypoint.sh
Normal file
17
entrypoint.sh
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/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
|
||||||
Reference in New Issue
Block a user