Comments (4)
It looks like your problem is related to your October CMS stack config. You aren't defining a shared cache or session driver, which is required when using the admin across replicas. Try this example:
version: '3.3'
services:
web:
image: aspendigital/octobercms:latest
ports:
- 80:80
environment:
- CACHE_STORE=redis
- DB_DATABASE=octobercms
- DB_HOST=mysql
- DB_PASSWORD=root
- DB_TYPE=mysql
- DB_USERNAME=root
- INIT_OCTOBER=true
- SESSION_DRIVER=redis
deploy:
replicas: 3
mysql:
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=octobercms
redis:
image: redis:5
I should also point out your web_data
volume may not function as you are expecting. When using Swarm across multiple nodes, a volume will be created on each host. The data from each won't be synced across hosts.
You can overcome this by leveraging introducing cloud storage for October CMS Filesystem.
from docker-octobercms.
Thanks!
from docker-octobercms.
Hmm. I'm unable to recreate your issue. Can you offer some more specifics? E.g. your traefik.toml, October CMS container settings...
from docker-octobercms.
I followed this tutorial on how to setup docker swarm cluster using traefic: https://dockerswarm.rocks
This is the configuration for october cms:
version: '3.3'
volumes:
web_data: {}
networks:
net:
driver: overlay
attachable: true
traefik-public:
external: true
services:
web:
image: aspendigital/octobercms:latest
networks:
- net
- default
- traefik-public
environment:
- DB_TYPE=mysql
- DB_HOST=mysql
- DB_DATABASE=****
- DB_USERNAME=****
- DB_PASSWORD=****
- CMS_LINK_POLICY=secure
container_name: october
volumes:
- web_data:/var/www/html/storage/app
deploy:
mode: replicated
replicas: 3
labels:
- traefik.frontend.rule=Host:example.com
- traefik.enable=true
- traefik.port=80
- traefik.tags=${TRAEFIK_PUBLIC_TAG:-traefik-public}
- traefik.docker.network=traefik-public
# Traefik service that listens to HTTP
- traefik.redirectorservice.frontend.entryPoints=http
- traefik.redirectorservice.frontend.redirect.entryPoint=https
# Traefik service that listens to HTTPS
- traefik.webservice.frontend.entryPoints=https
Configuration for traefic:
version: '3.3'
services:
...
# consul images
...
traefik:
image: traefik:v1.7
ports:
- 80:80
- 443:443
deploy:
replicas: 3
placement:
constraints:
- node.role == manager
preferences:
- spread: node.id
labels:
- traefik.frontend.rule=Host:traefik.${DOMAIN}
- traefik.enable=true
- traefik.port=8080
- traefik.tags=traefik-public
- traefik.docker.network=traefik-public
# Traefik service that listens to HTTP
- traefik.redirectorservice.frontend.entryPoints=http
- traefik.redirectorservice.frontend.redirect.entryPoint=https
# Traefik service that listens to HTTPS
- traefik.webservice.frontend.entryPoints=https
- traefik.frontend.auth.basic.users=${USERNAME}:${HASHED_PASSWORD}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command:
--docker
--docker.swarmmode
--docker.watch
--docker.exposedbydefault=false
--constraints=tag==traefik-public
--entrypoints='Name:http Address::80'
--entrypoints='Name:https Address::443 TLS'
--consul
--consul.endpoint="consul-leader:8500"
--acme
--acme.email=${EMAIL}
--acme.storage="traefik/acme/account"
--acme.entryPoint=https
--acme.httpChallenge.entryPoint=http
--acme.onhostrule=true
--acme.acmelogging=true
--logLevel=INFO
--accessLog
--api
networks:
- default
- traefik-public
depends_on:
- consul-leader
volumes:
consul-data-leader:
consul-data-replica:
networks:
traefik-public:
external: true
from docker-octobercms.
Related Issues (20)
- PHP 7.4 support HOT 1
- how to set PHP max_execution_time ? HOT 2
- Add kubernetes charts
- Update README with ssl notes HOT 2
- Problem writing to the storage directory HOT 4
- Build 465 images are not accessible HOT 1
- cron runs with different env variables HOT 4
- Theme volume assets not found in browser
- Xdebug error HOT 1
- Installing Plugin Dependencies on `docker-compose up` HOT 1
- Trying to user PHP 7.4-apache Dockerfile : Composer Error HOT 4
- [Feature Request] Upgrade to Octobercms v1.1 HOT 2
- Enable Supervisor? HOT 1
- Bad protocol version. Please update to a newer version of October CMS (Build >472 or >v1.1.5) and try again. HOT 2
- How to enable more PHP Extensions? HOT 1
- Support for OctoberCMS V2.0 HOT 1
- Actualize tags of images in Docker Hub HOT 1
- Wrong url / missing port in storage/app urls
- Google Cloud Run Dockerfile version? HOT 1
- How to use Dockerfile for actual new version of October CMS?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-octobercms.