services: wordpress: build: . sysctls: net.ipv4.ip_unprivileged_port_start: 0 ports: - 8080:80 environment: WORDPRESS_DB_HOST: db WORDPRESS_DB_USER: wpuser WORDPRESS_DB_PASSWORD: wppass WORDPRESS_DB_NAME: wordpress WORDPRESS_CONFIG_EXTRA: | define( 'DISALLOW_FILE_EDIT', true); define( 'DISALLOW_FILE_MODS', true); define( 'AUTOMATIC_UPDATER_DISABLED', true); define( 'WP_AUTO_UPDATE_CORE', false); define( 'WP_HOME', 'http://localhost:8080'); define( 'WP_SITEURL', 'http://localhost:8080'); volumes: - wordpress:/var/www/html depends_on: db: condition: service_healthy db: image: mysql:8.0 environment: MYSQL_DATABASE: wordpress MYSQL_USER: wpuser MYSQL_PASSWORD: wppass MYSQL_RANDOM_ROOT_PASSWORD: "1" volumes: - db:/var/lib/mysql healthcheck: test: ["CMD", "mysqladmin", "ping", "-h", "localhost"] timeout: 20s retries: 10 interval: 5s # cli: # image: wordpress:cli # command: sleep infinity # environment: # WORDPRESS_DB_HOST: db # WORDPRESS_DB_USER: wpuser # WORDPRESS_DB_PASSWORD: wppass # WORDPRESS_DB_NAME: wordpress # WORDPRESS_CONFIG_EXTRA: | # define( 'DISALLOW_FILE_EDIT', true); # define( 'DISALLOW_FILE_MODS', true); # define( 'AUTOMATIC_UPDATER_DISABLED', true); # define( 'WP_AUTO_UPDATE_CORE', false); # define( 'WP_HOME', 'http://localhost:8080'); # define( 'WP_SITEURL', 'http://localhost:8080'); # volumes: # - wordpress:/var/www/html # depends_on: # - db volumes: wordpress: db: