Skip to content

Commit 592f5ff

Browse files
committed
Adding the possibility to change the php version
Readme improvements Bugfixing, the gitignore was ignoring itself
2 parents 7b9c5e5 + f7c5c87 commit 592f5ff

File tree

5 files changed

+52
-15
lines changed

5 files changed

+52
-15
lines changed

README.md

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,43 @@ For be able to manipulate easily the files of wordpress you need to:
1515
## Steps to begin with a new WP project
1616

1717
1. Create the user using phpmyadmin
18-
- Set as `Host name` **=** `Use text field`= `wp_server`
19-
2. Download the WordPress core using `docker exec wp_server wp core download`
20-
3. Create your `wp-config` file `docker exec -ti wp_server wp core config --prompt`
21-
- 1/12 --dbname=<**dbname**>: `YOUR_DB_NAME`
22-
- 2/12 --dbuser=<**dbuser**>: `USER_CREATED_AT_1`
23-
- 3/12 [--dbpass=<**dbpass**>]: `PASS_CREATED_AT_1`
24-
- 4/12 [--dbhost=<**dbhost**>]: `wp_mariadb`
25-
- 5...12 - Default values set by enter
26-
4. Create db `docker exec -ti wp_server wp db create`
27-
5. Install WordPress site `docker exec -ti wp_server wp core install --prompt`
28-
- 1/6 --url=<**url**>: `localhost`
29-
- 2...6 - Your personal configuration
18+
- allow conection from any host
19+
- create a database with the same name with all priviledges
20+
2. Download the WordPress core using
21+
- `docker exec wp_server wp core download`
22+
3. Create your `wp-config` file
23+
- `docker exec -ti wp_server wp core config --prompt`
24+
- 1/12 --dbname=<**dbname**>: `YOUR_DB_NAME`
25+
- 2/12 --dbuser=<**dbuser**>: `USER_CREATED_AT_1`
26+
- 3/12 [--dbpass=<**dbpass**>]: `PASS_CREATED_AT_1`
27+
- 4/12 [--dbhost=<**dbhost**>]: `wp_mariadb`
28+
- 5...12 - Default values set by enter
29+
4. Install WordPress site
30+
- `docker exec -ti wp_server wp core install --prompt`
31+
- 1/6 --url=<**url**>: `localhost`
32+
- 2...6 - Your personal configuration
33+
34+
## Changing the PHP version
35+
36+
1. stop everything with
37+
- `docker-compose stop`
38+
39+
2. On the `docker-compose.yml` file, on service `wp_server` on the section `args` leave uncommented the php version that you want
40+
```yml
41+
args:
42+
PHP_VERSION: 7.1
43+
# PHP_VERSION: 7.0
44+
# PHP_VERSION: 5.6
45+
```
46+
3. Then build the new image with:
47+
- `docker-compose build`
48+
4. Run everything again:
49+
- `export UID && docker-compose up`
50+
51+
5. To verify the version run
52+
- `docker exec wp_server php --version`
53+
54+
------------------
3055

3156
## DB useful commands
3257
### Log into
@@ -50,4 +75,3 @@ MariaDB [(none)]> SHOW DATABASES;
5075
```
5176
5277
> Written with [StackEdit](https://stackedit.io/).
53-

docker-compose.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ services:
1515
- wp_server
1616

1717
wp_server:
18-
build: ./docker-images/php/
18+
build:
19+
context: ./docker-images/php/
20+
args:
21+
PHP_VERSION: 7.1
22+
# PHP_VERSION: 7.0
23+
# PHP_VERSION: 5.6
1924
user: ${UID}:www-data
2025
container_name: wp_server
2126
volumes:

docker-images/php/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
FROM php:7.1-fpm-alpine
1+
ARG PHP_VERSION
2+
3+
FROM php:"$PHP_VERSION"-fpm-alpine
24

35
# docker-entrypoint.sh dependencies
46
RUN apk add --no-cache \

www/wp_DB/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!.no-media
3+
!.gitignore

www/wp_files/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!.no-media
3+
!.gitignore

0 commit comments

Comments
 (0)