Created
December 1, 2023 23:05
-
-
Save nioperas06/784cdc8807d47e50243033f24ac47810 to your computer and use it in GitHub Desktop.
Docker swarm demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.2' | |
services: | |
db: | |
image: mariadb:10.6.4-focal | |
command: '--default-authentication-plugin=mysql_native_password' | |
volumes: | |
- db_data:/var/lib/mysql | |
networks: | |
- my-network | |
environment: | |
- MYSQL_ROOT_PASSWORD=somewordpress | |
- MYSQL_DATABASE=wordpress | |
- MYSQL_USER=wordpress | |
- MYSQL_PASSWORD=wordpress | |
ports: | |
- 3306:3306 | |
- 33060:33060 | |
wordpress: | |
image: wordpress:latest | |
ports: | |
- 80:80 | |
networks: | |
- my-network | |
environment: | |
- WORDPRESS_DB_HOST=db | |
- WORDPRESS_DB_USER=wordpress | |
- WORDPRESS_DB_PASSWORD=wordpress | |
- WORDPRESS_DB_NAME=wordpress | |
agent: | |
image: portainer/agent:2.19.3 | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
- /var/lib/docker/volumes:/var/lib/docker/volumes | |
networks: | |
- my-network | |
deploy: | |
mode: global | |
placement: | |
constraints: [node.platform.os == linux] | |
portainer: | |
image: portainer/portainer-ce:2.19.3 | |
command: -H tcp://tasks.agent:9001 --tlsskipverify | |
ports: | |
- "9443:9443" | |
- "9000:9000" | |
- "8000:8000" | |
volumes: | |
- portainer_data:/data | |
networks: | |
- my-network | |
deploy: | |
mode: replicated | |
replicas: 1 | |
placement: | |
constraints: [node.role == manager] | |
volumes: | |
db_data: | |
portainer_data: | |
networks: | |
my-network: | |
driver: overlay | |
attachable: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment