services: app: build: context: . args: - IMAGE_TAG_PREFIX - PHP_VERSION platform: linux/amd64 links: - consul - httpbin:local.httpbin.org - mysql - nacos - oracle - php-fpm - pgsql - redis - wordpress - mongodb environment: DISABLE_DEFAULT_SERVER: 1 GITHUB_ACTIONS: "yes" # /var/www is the bind mount below, owned on the host by whoever checked the code out -- the runner user # on GitHub Actions -- while everything in this container runs as root. Git refuses to read a repository # owned by somebody else ("detected dubious ownership"), and so does every tool that shells out to it: # Composer guesses the root package version with `git branch -a --no-color --no-abbrev -v` and reports # the version as 1.0.0 once that fails. These three variables are git's "command" configuration scope, # one of the three scopes it considers protected; safe.directory is deliberately ignored from anywhere # else. `docker compose exec` inherits them, so every step gets the exception. Adding a second setting # here means raising GIT_CONFIG_COUNT to match. GIT_CONFIG_COUNT: 1 GIT_CONFIG_KEY_0: safe.directory GIT_CONFIG_VALUE_0: /var/www ports: - "80:80" volumes: - .:/var/www - wordpress:/var/www/html php-fpm: image: php:8.4-fpm volumes: - .:/var/www wordpress: image: wordpress:php8.4-fpm links: - mysql environment: WORDPRESS_DB_HOST: mysql WORDPRESS_DB_USER: username WORDPRESS_DB_PASSWORD: password WORDPRESS_DB_NAME: test WORDPRESS_TABLE_PREFIX: wp_ volumes: - type: volume source: wordpress target: /var/www/html volume: nocopy: false mysql: image: mysql:8 environment: MYSQL_DATABASE: test MYSQL_USER: username MYSQL_PASSWORD: password MYSQL_ROOT_PASSWORD: password pgsql: image: postgres:17-alpine environment: POSTGRES_DB: test POSTGRES_USER: username POSTGRES_PASSWORD: password oracle: image: gvenzl/oracle-xe:slim platform: linux/amd64 environment: ORACLE_PASSWORD: oracle redis: image: redis:7.2 # A local stand-in for httpbin.org (a Go reimplementation of its API), so the HTTP/curl tests are not at the # mercy of the real site's throttling. The app container reaches it as local.httpbin.org (see the link alias # above), on the default HTTP port so that URLs and Host headers look just like the httpbin.org ones. httpbin: image: mccutchen/go-httpbin environment: PORT: 80 mongodb: image: mongodb/mongodb-community-server:8.0-ubi8 container_name: mongodb restart: always ports: - "27017:27017" nacos: image: nacos/nacos-server platform: linux/amd64 environment: MODE: standalone PREFER_HOST_MODE: hostname consul: image: consul:1.15 command: consul agent -dev -client=0.0.0.0 volumes: wordpress: