ansible_wordpress-standalone/docker-compose.yml

45 lines
1.1 KiB
YAML
Raw Normal View History

version: '3.6'
services:
wordpress:
build: ./wordpress/apache
2024-08-17 23:17:56 +00:00
volumes:
- ~/wordpress/data:/var/www/html
depends_on:
- db
ports:
- 8080:80 # change to 80:80 when the shop is ready to go live
2024-08-19 21:36:57 +00:00
- 4443:443 # change to 80:80 when the shop is ready to go live
restart: always
env_file: ".env"
2024-08-19 20:00:53 +00:00
db:
image: mysql:5.7
volumes:
- ~/wordpress/database:/var/lib/mysql
restart: always
env_file: ".env"
wordpress-cli:
depends_on:
- db
- wordpress
image: wordpress:cli
# vstm: This is required to run wordpress-cli with the same
# user-id as wordpress. This way there are no permission problems
# when running the cli
user: '33'
# vstm: The sleep 10 is required so that the command is run after
# mysql is initialized. Depending on your machine this might take
# longer or it can go faster.
command: >
/bin/sh -c '
sleep 10;
wp user list'
# vstm: add shared volume
volumes:
- ~/wordpress/data:/var/www/html
# WP CLI needs the environment variables used for the Wordpress image
env_file: ".env"