I'm running docker-letsencrypt through a docker-compose.yml file. It comes with PHP. I'm trying to run PHP composer with it. I can install composer while being in the container through bash, but that won't stick when I recreate the container. How do I keep a permanent install of composer in an existing container that doesn't come with compose by default?
My docker-compose.yml looks like this:
version: "3"
services:
letsencrypt:
image: linuxserver/letsencrypt
container_name: letsencrypt
cap_add:
- NET_ADMIN
ports:
- "80:80"
- "443:443"
environment:
- PUID=1000
- PGID=1000
- EMAIL=<mailadress>
- URL=<tld>
- SUBDOMAINS=<subdomains>
- VALIDATION=http
- TZ=Europe/Paris
volumes:
- /home/ubuntu/letsencrypt:/config
I did find the one-line installer for composer:
php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer
I could add this to command in my docker-compose.yml, but that would reinstall composer even on container restarts right?