diff --git a/Dockerfile b/Dockerfile old mode 100644 new mode 100755 index dedb0f5..a65ed1e --- a/Dockerfile +++ b/Dockerfile @@ -16,5 +16,9 @@ RUN bundle install ADD . /app WORKDIR /app +COPY ./docker-entrypoint.sh / +RUN chmod +x docker-entrypoint.sh + EXPOSE 3000 +ENTRYPOINT ["/docker-entrypoint.sh"] CMD ["rails", "server", "-b", "0.0.0.0"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100755 index 0000000..4749050 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e + +if [ -f ./tmp/pids/server.pid ]; then + rm ./tmp/pids/server.pid +fi + +exec bundle exec "$@"