diff --git a/Dockerfile b/Dockerfile index c52d06944..a03ceceef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,8 +4,6 @@ FROM phusion/passenger-ruby31:latest ENV HOME /home/app/deploy -CMD ["/sbin/my_init"] - # Install common dependencies RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ --mount=type=cache,target=/var/lib/apt,sharing=locked \ @@ -85,6 +83,10 @@ COPY --chown=app:app . . RUN SKIP_SALESFORCE_INIT=true SKIP_FLIPPER_INIT=true SECRET_KEY_BASE=dummyvalue bundle exec rake assets:precompile -EXPOSE 3000 +RUN mkdir -p /etc/my_init.d +COPY docker/puma.sh /etc/my_init.d/puma.sh +COPY docker/workers.sh /etc/my_init.d/workers.sh -ENTRYPOINT sh ./web-entrypoint.sh + +CMD ["/sbin/my_init"] +EXPOSE 3000 diff --git a/docker/puma.sh b/docker/puma.sh new file mode 100644 index 000000000..bfc8f2149 --- /dev/null +++ b/docker/puma.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +cd /home/app/deploy && exec bundle exec rails server -b 0.0.0.0 -p 3000 >>/var/log/puma.log 2>&1 diff --git a/docker/workers.sh b/docker/workers.sh new file mode 100644 index 000000000..4aea5d71f --- /dev/null +++ b/docker/workers.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +cd /home/app/deploy && exec bundle exec rake jobs:work >>/var/log/workers.log 2>&1 diff --git a/web-entrypoint.sh b/web-entrypoint.sh deleted file mode 100644 index 1f1b81f9c..000000000 --- a/web-entrypoint.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Database migration - -echo 'prepping database' - -bin/rails db:migrate - -# Runs rails server - -echo 'running server' - -bundle exec rails server -b 0.0.0.0 -p 3000 & rake jobs:work