How to start service only when other service had completed?

This is a supplement to @zooblin ‘s answer Since docker-compose version 1.29, we can do it by condition: service_completed_successfully In your scene, database service start will cost some time, so the migration scripts should be executed after database fully started. And the application service should start after migration scripts executed successfully. the docker-compose.yaml may be … Read more

Volume mount when setting up WordPress with docker

Maybe I’ve found something… volumes: – wp-content:/var/www/html/wp-content According to this article: …wp-content contains all user-supplied content. Basically anything you can upload to your site ends up here. That doesn’t include anything you write, mind you. Those things are stored in the WordPress database. However, as long as you have both the database and your wp-content … Read more

How to configure docker container proxy?

You can set the proxy environment variables when starting the container, for example: docker container run \ -e HTTP_PROXY=http://username:[email protected] \ -e HTTPS_PROXY=http://username:[email protected] \ myimage If you want the proxy-server to be automatically used when starting a container, you can configure default proxy-servers in the Docker CLI configuration file (~/.docker/config.json). You can find instructions for this … Read more

ignore all .git folders in .dockerignore

It suffices to use the ** pattern. For example: .dockerignore **/.git The relevant passage from that page of the official doc is: .dockerignore file […] Matching is done using Go’s filepath.Match rules. A preprocessing step removes leading and trailing whitespace and eliminates . and .. elements using Go’s filepath.Clean. Lines that are blank after preprocessing … Read more

Docker Bridge Conflicts with Host Network

When docker networks are created (e.g. using docker network create or indirectly through docker-compose) without explicitly specifying a subnet range, dockerd allocates a new /16 network, starting from 172.N.0.0/16, where N is a number that is incremented (e.g. N=17, N=18, N=19, N=20, …). A given N is skipped if a docker network (a custom one, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)