Project for a wordpress swarm
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

209 lines
4.2 KiB

version: '3.7'
services:
db:
image: mariadb
container_name: mariadb
volumes:
- db_data:/var/lib/mysql
ports:
- "3306:3306"
networks:
- wp-net
restart: always
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
deploy:
placement:
constraints: [node.role == worker]
replicas: 1
update_config:
delay: 10s
restart_policy:
condition: on-failure
wordpress:
depends_on:
- db
image: wordpress:latest
container_name: wordpress
ports:
- "9000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
volumes:
- wordpress:/var/www/html
networks:
- wp-net
deploy:
placement:
constraints: [node.role == worker]
replicas: 1
resources:
limits: #max resources
cpus: '0.50'
memory: 50M
reservations: #default resources
cpus: '0.25'
memory: 20M
update_config:
delay: 10s
restart_policy:
condition: on-failure
nginx:
image: nginx
ports:
- 80:80
- 443:443
volumes:
- wordpress:/var/www/html
- ./nginx.conf:/etc/nginx/conf.conf
depends_on:
- wordpress
networks:
- wp-net
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
minio1:
image: minio/minio:RELEASE.2020-06-03T22-13-49Z
hostname: minio1
volumes:
- minio1-data:/export
ports:
- "9005:9000"
networks:
- minio_distributed
deploy:
restart_policy:
delay: 10s
max_attempts: 10
window: 60s
placement:
constraints:
- node.labels.minio1==true
command: server http://minio{1...4}/export
secrets:
- secret_key
- access_key
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
minio2:
image: minio/minio:RELEASE.2020-06-03T22-13-49Z
hostname: minio2
volumes:
- minio2-data:/export
ports:
- "9006:9000"
networks:
- minio_distributed
deploy:
restart_policy:
delay: 10s
max_attempts: 10
window: 60s
placement:
constraints:
- node.labels.minio2==true
command: server http://minio{1...4}/export
secrets:
- secret_key
- access_key
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
minio3:
image: minio/minio:RELEASE.2020-06-03T22-13-49Z
hostname: minio3
volumes:
- minio3-data:/export
ports:
- "9007:9000"
networks:
- minio_distributed
deploy:
restart_policy:
delay: 10s
max_attempts: 10
window: 60s
placement:
constraints:
- node.labels.minio3==true
command: server http://minio{1...4}/export
secrets:
- secret_key
- access_key
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
minio4:
image: minio/minio:RELEASE.2020-06-03T22-13-49Z
hostname: minio4
volumes:
- minio4-data:/export
ports:
- "9008:9000"
networks:
- minio_distributed
deploy:
restart_policy:
delay: 10s
max_attempts: 10
window: 60s
placement:
constraints:
- node.labels.minio4==true
command: server http://minio{1...4}/export
secrets:
- secret_key
- access_key
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
volumes:
minio1-data:
minio2-data:
minio3-data:
minio4-data:
db_data:
wordpress:
networks:
wp-net:
minio_distributed:
driver: overlay
secrets:
secret_key:
external: true
access_key:
external: true