environment
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 docker 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"
User and Group
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)
Time zone
You can add a valiable for your timezone time zones
TZ="Europe/Zurich"
Basic auth
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"
Domain name
You can configure your host name as domain name and reference it in all services, this makes it easy to reuse a docker file on different hosts.
DOMAINNAME="apu01.home"
DNS Server
The default DNS Server
DNS=192.168.1.254