How do I read a secret file in a container docker-compose?

Viewed 80

I attach a file to docker-compose:

environment:
      - "MSMTP_CONFIG_FILE=/run/secrets/msmtprc"

The php.ini uses this file in this way:

sendmail_path = "msmtp -C $MSMTP_CONFIG_FILE -t"

But in the logs it gives the following:

msmtp: /run/secrets/msmtprc: contains secrets and therefore must be owned by you

The file has permission 1000:1000. I tried to create a group with such a gid and add the user www-data there, but it did not help. How to read data from a file correctly?

0 Answers
Related