A Docker environment file is a simple text file that contains a list of environment variables and their values. This file is used to store your Password Pusher environment variables and pass them to the Docker container.

Creating a Docker Environment File

To create a Docker environment file, simply create a new text file with a .env extension (e.g., pwpush-docker-env-file.env). Add the environment variables and their values to the file, one per line, in the format VARIABLE_NAME=value.

Here is an example of what the file might look like:

PWP__ENABLE_LOGINS=true
PWP__MAIL__RAISE_DELIVERY_ERRORS=true
PWP__MAIL__SMTP_ADDRESS=smtp.example.com
PWP__MAIL__SMTP_PORT=587
PWP__MAIL__SMTP_USER_NAME=myuser
PWP__MAIL__SMTP_PASSWORD=mypassword
PWP__MAIL__SMTP_AUTHENTICATION=plain
PWP__MAIL__SMTP_STARTTLS=true
PWP__MAIL__SMTP_OPEN_TIMEOUT=10
PWP__MAIL__SMTP_READ_TIMEOUT=10
PWP__HOST_DOMAIN=example.com
PWP__HOST_PROTOCOL=https
PWP__MAIL__MAILER_SENDER="Sender Name" <email@address.111>
PWP__ENABLE_FILE_PUSHES=true
PWP__FILES__STORAGE=local
PWP__FILES__S3__ENDPOINT=s3.amazonaws.com
PWP__FILES__S3__ACCESS_KEY_ID=BKIBIOSFODNN7EXAMPLE
PWP__FILES__S3__SECRET_ACCESS_KEY=wJalsXUtnaEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
PWP__FILES__S3__REGION=us-west-2
PWP__FILES__S3__BUCKET=my-bucket
PWP__FILES__EXPIRE_AFTER_DAYS_DEFAULT=2
PWP__FILES__EXPIRE_AFTER_DAYS_MAX=7
PWP__FILES__EXPIRE_AFTER_VIEWS_DEFAULT=5
PWP__FILES__EXPIRE_AFTER_VIEWS_MAX=10
PWP__FILES__RETRIEVAL_STEP_DEFAULT=true
PWP__ENABLE_URL_PUSHES=true

Passing the Environment File to Docker

To pass the environment file to Docker, use the -e flag followed by the path to the environment file. For example:

docker run -d --env-file ./pwpush-docker-env-file pglombardo/pwpush:latest

This will pass the environment variables in the pwpush-docker-env-file.env file to the Docker container running the pglombardo/pwpush:latest image.

Additional Resources

For more information on the Docker syntax for environment files, refer to the Docker documentation on environment variables and env files.

Updated: