|
|
|
|
|
by chewchew
3536 days ago
|
|
Distributed storage is still a big issue for sure. There are some options, but none are ideal. One option is to map to host and use NFS to share across hosts. Another option is to use something like Convoy or Flocker, which come with their own complexities and limitations. Hopefully more progress is made on this front. As for the wordpress app and other issues mentioned, it's actually very simple: nginx:
build: ./nginx/
ports:
- "80:80"
volumes_from:
- php-fpm
links:
- php-fpm
php-fpm:
build: ./php-fpm/
volumes:
- ${WORDPRESS_DIR}:/var/www/wordpress
links:
- db
db:
image: mysql
environment:
MYSQL_DATABASE: wordpress
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
volumes:
- /data/mydb:/var/lib/mysql
This isn't a "production" config, but that wouldn't look that much different. The real beauty is that I found this compose file with a simple search and very easily made minor tweaks (e.g. not publicly exposing the mysql ports).You might run into permissions issues if you use host mounted volumes, but I have not. Normally I prefer to use named volumes (docker-compose v2) and regularly backup the volumes up to S3 using Convoy or a simple sidecar container with a mysqldump script. |
|
Let's say I want to run a Wordpress hosting service. In my ideal world, I deploy an "immutable" container for each customer, i.e. everyone gets an identical container with Wordpress, Nginx, MySQL etc. So what to do with state info, like configs and the MySQL data files? I'm thinking of mounting a drive at the same point inside each container e.g. /mnt/data/ and /mnt/config/ or similar.
This way the containers can all be identical at time of deployment, and I can manage the volumes that attach to those mount points using some dedicated tool/process.
This is all still on the drawing-board... but what you've said here seems to suggest this approach should work. Or have I optimistically misinterpreted what you've said? :)