diff --git a/install-wordpress-on-portainer/docker-compose.yml b/install-wordpress-on-portainer/docker-compose.yml new file mode 100644 index 0000000..3d774c8 --- /dev/null +++ b/install-wordpress-on-portainer/docker-compose.yml @@ -0,0 +1,51 @@ +version: "3" # Specifies the version of the Docker Compose file format + +# Service definitions for the wordpress application +services: + # Service definition for the main application + app: + # Docker image to use for the application + image: wordpress:latest + # Port mapping for the application + ports: + - 8080:80 + # Environment variables for the application + environment: + WORDPRESS_DB_HOST: db + WORDPRESS_DB_USER: portainer + WORDPRESS_DB_PASSWORD: portainer + WORDPRESS_DB_NAME: wordpress + # Volume mapping for the application + volumes: + - wordpress_data:/var/www/html + # Service dependencies for the application + depends_on: + - db + networks: + - wordpress-network + + # Service definition for the database + db: + # Docker image to use for the database + image: mysql:5.7 + # Environment variables for the database + environment: + MYSQL_DATABASE: wordpress + MYSQL_USER: portainer + MYSQL_PASSWORD: portainer + MYSQL_ROOT_PASSWORD: portainer + # Volume mapping for the database + volumes: + - wordpress_db_data:/var/lib/mysql + networks: + - wordpress-network + +# Network definitions for the wordpress application +networks: + wordpress-network: + driver: bridge + +# Volume definitions for the wordpress application +volumes: + wordpress_data: + wordpress_db_data: