Skip to main content

environment file

The environment file can be used to store global configuration parameters for your docker-compose file. The file is stored in /etc/environment.

The following configuration is largely based on 1docker media server how to.

vim /etc/environment

After a standard ubuntu 18.04 installation the environment file probably looks like this

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"

In my basic setup I create a user cloud and a group cloud that I run docker-compose with, in my environment file I specify the ids of the user and group as parameters.

PUID=1002
PGID=1002

You can get the values for your user via the following command

sudo id cloud

this shoudl output some thing like this

uid=1002(cloud) gid=1002(cloud) groups=1002(cloud)

You can add a valiable for your timezone 2time zones

TZ="Europe/Zurich"

You can specify a basic auth user that you can use to secure pages, you can encode the password as follows

echo $(htpasswd -nb admin supersecret) | sed -e s/\\$/\\$\\$/g

That would result in some thing as admin:$$apr1$$o6BgYlgS$$U3GfcrYe6/7Ir2bVvVit61 that you could than add as follows

HTTP_USERNAME=admin
HTTP_PASSWORD="$$apr1$$o6BgYlgS$$U3GfcrYe6/7Ir2bVvVit61"