# doc : https://docs.docker.com/compose/compose-file/compose-versioning/ # version : https://docs.docker.com/compose/compose-file/compose-versioning/ # version to download : https://github.com/docker/compose/releases/ # had to remove the apt version because it was not up to date (sudo apt remove docker-compose) # then install as recommended : curl -SL https://github.com/docker/compose/releases/download/v2.10.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose # or (neat) : https://github.com/docker/compose/releases/download/v2.10.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose version: "3.8" services: # --------------------------------- # test: # build: # context: ./requirements/test # dockerfile: Dockerfile # image: test # container_name: test_container # --------------------------------- nginx: restart: on-failure networks: - inception ports: - "443:443" #- "80:80" volumes: - wp_volume:${WP_DIR} - wp_plugins:${WP_PLUGIN_DIR} build: context: ./requirements/nginx args: - WP_URL=${WP_URL} - MAX_UPLOAD_SIZE=${MAX_UPLOAD_SIZE} image: nginx container_name: nginx_container depends_on: wordpress: condition: service_started # --------------------------------- mariadb: restart: on-failure env_file: .env networks: - inception volumes: - db_volume:/var/lib/mysql build: context: ./requirements/mariadb args: - DB_HOST=${DB_HOST} - DB_NAME=${DB_NAME} - DB_USER=${DB_USER} - DB_PSWD=${DB_PSWD} healthcheck: test: mariadb -h ${DB_HOST} -u ${DB_USER} -p"${DB_PSWD}" -e exit 2> /dev/null interval: 1s timeout: 10s retries: 10 image: mariadb container_name: mariadb_container # --------------------------------- wordpress: restart: on-failure env_file: ./.env networks: - inception volumes: - wp_volume:${WP_DIR} - wp_plugins:${WP_PLUGIN_DIR} build: context: ./requirements/wordpress args: - WP_DIR=${WP_DIR} - MAX_UPLOAD_SIZE=${MAX_UPLOAD_SIZE} - EXECUTION_TIME=${EXECUTION_TIME} image: wordpress container_name: wordpress_container depends_on: mariadb: condition: service_healthy # specify path to named volumes : https://docs.docker.com/compose/compose-file/compose-file-v3/#volume-configuration-reference volumes: wp_volume: driver: local driver_opts: type: none o: "bind" device: ${MAP_VOLUMES}/wp_volume wp_plugins: driver: local driver_opts: type: none o: "bind" device: ${MAP_VOLUMES_PLUGINS} db_volume: driver: local driver_opts: type: none o: "bind" device: ${MAP_VOLUMES}/db_volume networks: inception: