Compare commits

...

4 Commits
main ... master

4 changed files with 24 additions and 4 deletions

View File

@ -1,7 +1,8 @@
# Wordpress - make a copy of wp-includes to compare with existing volumes
# 'docker-compose exec wordpress bash -c 'cd /var/www/html/wp-includes && grep wp_version version.php'
FROM wordpress:6-fpm
ARG WORDPRESS_VERSION=user-defined
FROM wordpress:${WORDPRESS_VERSION}
# ancient debian
#RUN apt update && apt -y install vim less

View File

@ -5,9 +5,10 @@ A Docker-based toolkit that streamlines WordPress upgrades using official images
## Project Configuration
### Project Name
This project requires a project name, which should be defined in an `.env` file:
This project requires a project name and wordpress version, which should be defined in an `.env` file:
```bash
COMPOSE_PROJECT_NAME=test
WORDPRESS_VERSION=6-fpm
```
### Database Host Configuration
@ -60,6 +61,15 @@ HTML_VOLUME=test_html_staging
1. Stop the current containers and remove volumes:
```bash
docker compose down -v
# Optional Steps
# Clean volumes
grep -E 'DB_VOLUME|CONTENT_VOLUME' .env | cut -d '=' -f2 | xargs -I {} sh -c 'docker volume rm {} 2>/dev/null; docker volume create {}'
# Remove Wordpress Image
docker rmi $(grep IMAGE_WEB .env | cut -d '=' -f2)
```
2. Update WordPress version:
@ -92,6 +102,13 @@ chmod -R [appropriate-permissions] wp-content/
5. Optional: Update database if needed:
```bash
(In the database container)
apt-get update && \
apt-get install -y mariadb-client && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
(From the host)
./update-db
```

View File

@ -7,10 +7,12 @@ services:
build:
context: .
dockerfile: Dockerfile.wordpress_fpm
args:
WORDPRESS_VERSION: ${WORDPRESS_VERSION}
image: ${IMAGE_WEB:-web}
volumes:
- html:/var/www/html
environment:
environment:
- WORDPRESS_DB_HOST=${WORDPRESS_DB_HOST:-database:3306}
- WORDPRESS_DB_PASSWORD=${WORDPRESS_DB_PASSWORD:-fake}
- VIRTUAL_HOST=${VIRTUAL_HOST:-wordpress}

View File

@ -3,7 +3,7 @@
source ".env"
website="https://$VIRTUAL_HOST"
command="docker-compose exec database mysql"
command="docker compose exec database mariadb"
echo $website