diff --git a/Dockerfile b/Dockerfile index f4edf82..079bc26 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,18 +36,17 @@ COPY --from=builder --chown=app:app /app . RUN bundle config --local path vendor/bundle \ && bundle config set --local without 'development test' -ENV PORT 3000 -ENV RAILS_ENV production -ENV DATABASE_URL "mysql2://myuser:mypass@hostname/somedatabase" -ENV RAILS_SERVE_STATIC_FILES true -ENV RAILS_LOG_TO_STDOUT true +ENV PORT=3000 +ENV RAILS_ENV=production +ENV DATABASE_URL="mysql2://myuser:mypass@hostname/somedatabase" +ENV RAILS_SERVE_STATIC_FILES=true +ENV RAILS_LOG_TO_STDOUT=true -ENV MAILSERVER_HOSTNAME mail.example.com -ENV WEBMAIL_HOSTNAME webmail.example.com -ENV API_TOKEN "" -ENV CONFIGRELOAD_WEBHOOK "" +ENV MAILSERVER_HOSTNAME=mail.example.com +ENV WEBMAIL_HOSTNAME=webmail.example.com +ENV API_TOKEN="" +ENV CONFIGRELOAD_WEBHOOK="" EXPOSE $PORT -CMD bundle exec rails db:migrate \ - && bundle exec puma -C config/puma.rb +CMD ["/app/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..384eaf7 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -Eeuo pipefail + +bundle exec rails db:migrate + +exec bundle exec puma -C config/puma.rb diff --git a/integrations/docker-mailserver-configreload/Dockerfile b/integrations/docker-mailserver-configreload/Dockerfile index bac56ad..8340208 100644 --- a/integrations/docker-mailserver-configreload/Dockerfile +++ b/integrations/docker-mailserver-configreload/Dockerfile @@ -8,11 +8,11 @@ RUN pip install jinjanator COPY bin/ /usr/local/bin/ COPY templates/ /usr/local/share/templates/ -ENV WEBHOOK_TOKEN=some-random-long-string \ - WEBHOOK_LOG=/var/log/webhook/access.log \ - CONFIG_DIR=/config \ - CONFIG_TMP=/tmp/config \ - MAILADMIN_URL=https://mailadmin.example.com \ - MAILADMIN_API_TOKEN=some-secret-token +ENV WEBHOOK_TOKEN=some-random-long-string +ENV WEBHOOK_LOG=/var/log/webhook/access.log +ENV CONFIG_DIR=/config +ENV CONFIG_TMP=/tmp/config +ENV MAILADMIN_URL=https://mailadmin.example.com +ENV MAILADMIN_API_TOKEN=some-secret-token CMD ["/usr/local/bin/entrypoint.sh"]