Skip to content

Commit

Permalink
upgrade: add wordpress stack
Browse files Browse the repository at this point in the history
update: readme
  • Loading branch information
rosario-fiorella committed May 28, 2024
1 parent 2354835 commit 2650129
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
src
!src/index.php
!src/health.php
data/db/*
!data/db/.gitkeep
data/mysql_57/*
!data/mysql_57/.gitkeep
data/nginx/log
Expand Down
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
- Docker version 26.1.3, build b72abbb
- Docker Compose version v2.27.0

## STACK
- [NGINX + PHP-FPM](#docker-stack)
- [Wordpress + WP-Cli](#wordpress)

## DOCKER STACK
- NGINX REVERSE PROXY
- PHP-FPM
Expand All @@ -30,7 +34,7 @@ to stop docker services
docker compose down
```

## XDEBUG
### XDEBUG
create file **launch.json**
```
{
Expand Down Expand Up @@ -60,4 +64,20 @@ open in browser
Check the status of the services
- open url http://localhost:8080/health.php

## WORDPRESS

to start wordpress services
```
docker compose -f docker-compose-wordpress.yml up -d
```
to stop docker services
```
docker compose down
```
Finally
open in browser
- WORDPRESS http://localhost
- WP-CLI, first enter the container ``docker exec -it wp /bin/bash``, then run from within the container ``wp --help``
- PHPMYADMIN http://localhost:8888

Enjoi!
79 changes: 79 additions & 0 deletions docker-compose-wordpress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
services:

db:
container_name: db
image: mysql
restart: always
environment:
MYSQL_DATABASE: wordpress
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: password
expose:
- 3306
volumes:
- ./data/db:/var/lib/mysql
networks:
- wp-network

phpmyadmin:
container_name: phpmyadmin
image: phpmyadmin
restart: always
depends_on:
- db
ports:
- 8888:80
networks:
- wp-network

wordpress:
container_name: wp
image: wordpress
restart: always
user: www-data:www-data
depends_on:
- db
ports:
- 80:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: user
WORDPRESS_DB_NAME: wordpress
WORDPRESS_DB_PASSWORD: password
WORDPRESS_TABLE_PREFIX: wp_
WORDPRESS_DEBUG: 1
volumes:
- ./src/wordpress:/var/www/html
networks:
- wp-network

wpcli:
container_name: wp-cli
image: wordpress:cli
restart: always
stdin_open: true
tty: true
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: user
WORDPRESS_DB_NAME: wordpress
WORDPRESS_DB_PASSWORD: password
WORDPRESS_TABLE_PREFIX: wp_
WORDPRESS_DEBUG: 1
entrypoint: ["wp", "--allow-root"]
depends_on:
- db
- wordpress
volumes:
- ./src/wordpress:/var/www/html
networks:
- wp-network

volumes:
db:
driver: local

networks:
wp-network:
driver: bridge
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
services:

nginx:
image: nginx:latest
restart: always
Expand Down

0 comments on commit 2650129

Please sign in to comment.