Skip to content

Commit

Permalink
Merge pull request #311 from aspettl/dockerfile-linter-issues
Browse files Browse the repository at this point in the history
Fix Dockerfile linter issues
  • Loading branch information
aspettl authored Oct 10, 2024
2 parents cd30097 + d486141 commit 295f804
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
21 changes: 10 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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=""

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/

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"]

0 comments on commit 295f804

Please sign in to comment.