Added pid file autoremoving
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -8,7 +8,8 @@ RUN apk add --no-cache \
|
|||||||
yarn \
|
yarn \
|
||||||
sqlite-dev \
|
sqlite-dev \
|
||||||
bash \
|
bash \
|
||||||
postgresql-dev
|
postgresql-dev \
|
||||||
|
python2
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@@ -31,7 +32,11 @@ VOLUME /app/db/database
|
|||||||
|
|
||||||
RUN yarn install --check-files; bundle exec rake assets:precompile
|
RUN yarn install --check-files; bundle exec rake assets:precompile
|
||||||
|
|
||||||
|
RUN apk del \
|
||||||
|
git \
|
||||||
|
python2 \
|
||||||
|
build-base
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/bash"]
|
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
|
||||||
CMD ["/app/entrypoint.sh"]
|
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ production:
|
|||||||
adapter: sqlite3
|
adapter: sqlite3
|
||||||
pool: 5
|
pool: 5
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
database: <%= ENV['DATABASE'] || "" %>
|
database: <%= ENV['DATABASE'] || "db/database/snibox.sqlite3" %>
|
||||||
@@ -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
|
|
||||||
Reference in New Issue
Block a user