How to set Docker-compose arguments in console?

admin

Administrator
Staff member
My Docker containers will be set up through a bash script.

In my docker-compose.yml file (which is called through
Code:
docker-compose up
inside the bash file) I have a few arguments:

Code:
version: "2"
services:
    nginx:
        build: ./Dockerfiles/wordpress-nginx
        expose:
            - "80"
        depends_on:
            - fpm
        links:
            - fpm
        container_name: wordpress-nginx
        args:
            - site_title=Example
            - [email protected]
            - site_url=www.testcase001.com
            - admin_user=admin
            - admin_pass=qwerty
            - ssl_domain=www.testcase001.com
            - dbname=testcase
            - dbuser=testcase
            - dbpass=testcase
            - dbhost=testcase
    fpm:
        build: ./Dockerfiles/php-fpm
        expose:
            - "9000"
        container_name: fpm

Now my question is this:

<strong><em>How can I set the arguments from the command line?</em></strong>

For example:<br>
I want to set the
Code:
site_title
argument:
Code:
docker-compose up --something-to-set-the-site_title-argument