Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Dockerfile linter issues #311

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,17 @@
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=""

Check warning on line 47 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build mailadmin images

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "API_TOKEN") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENV CONFIGRELOAD_WEBHOOK=""

EXPOSE $PORT

CMD bundle exec rails db:migrate \
&& bundle exec puma -C config/puma.rb
CMD ["/app/entrypoint.sh"]
6 changes: 6 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -Eeuo pipefail

bundle exec rails db:migrate

exec bundle exec puma -C config/puma.rb
12 changes: 6 additions & 6 deletions integrations/docker-mailserver-configreload/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]