fix finally server pid issue at docker container restart

This commit is contained in:
Joerg Reichert 2019-04-14 23:51:40 +02:00
parent d58e0091bb
commit 28ade2a8d9
2 changed files with 12 additions and 0 deletions

4
Dockerfile Normal file → Executable file
View file

@ -16,5 +16,9 @@ RUN bundle install
ADD . /app ADD . /app
WORKDIR /app WORKDIR /app
COPY ./docker-entrypoint.sh /
RUN chmod +x docker-entrypoint.sh
EXPOSE 3000 EXPOSE 3000
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["rails", "server", "-b", "0.0.0.0"] CMD ["rails", "server", "-b", "0.0.0.0"]

8
docker-entrypoint.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
set -e
if [ -f ./tmp/pids/server.pid ]; then
rm ./tmp/pids/server.pid
fi
exec bundle exec "$@"