Skip to content

Commit caae653

Browse files
committed
Update
1 parent 452f9d0 commit caae653

File tree

4 files changed

+23
-31
lines changed

4 files changed

+23
-31
lines changed

.env.example

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# MYSQL_ROOT_PASSWORD=rootpass
2-
DB_DATABASE=wordpress
3-
DB_USERNAME=dbadmin
4-
DB_PASSWORD=secret
1+
MYSQL_ROOT_PASSWORD=rootpass
2+
MYSQL_USER=dbadmin
3+
MYSQL_PASSWORD=secret
4+
MYSQL_DATABASE=wordpress

.github/README.md renamed to README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ An example for developing Wordpress sites with Docker and deploy to AWS Elastic
44

55
## Requiments
66

7-
- Bash
7+
- Bash shell
88
- Git
9-
- Docker
10-
- Docker Compose
9+
- Docker Engine 19.03.0+
10+
- Docker Compose 1.27.0+
1111

1212
## Project organisation
1313

docker-compose.yml

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
version: "3.5"
2-
3-
### Networks ###
41
networks:
52
mysql-net: {}
63
proxy-net: {}
74

8-
### Volumes ###
95
volumes:
106
mysql-vol: {}
117

12-
### Services ###
138
services:
149

15-
### Mysql service ###
1610
mysql:
1711
image: mysql:8.0
1812
command:
@@ -21,9 +15,9 @@ services:
2115
- --collation-server=utf8mb4_unicode_ci
2216
environment:
2317
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-rootpass}
24-
MYSQL_USER: ${DB_USERNAME}
25-
MYSQL_PASSWORD: ${DB_PASSWORD}
26-
MYSQL_DATABASE: ${DB_DATABASE}
18+
MYSQL_USER: ${MYSQL_USER}
19+
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
20+
MYSQL_DATABASE: ${MYSQL_DATABASE}
2721
networks:
2822
- mysql-net
2923
# ports:
@@ -33,13 +27,12 @@ services:
3327
- mysql-vol:/var/lib/mysql
3428
# - ./initdb:/docker-entrypoint-initdb.d:ro
3529
healthcheck:
36-
test: MYSQL_PWD=$$MYSQL_PASSWORD mysqladmin -u $$MYSQL_USER --silent ping
37-
start_period: 2s
38-
interval: 1s
30+
test: MYSQL_PWD=$$MYSQL_PASSWORD mysqladmin -h $$HOSTNAME -P 3306 -u $$MYSQL_USER --silent ping
31+
start_period: 15s
32+
interval: 3s
3933
timeout: 3s
40-
retries: 10
34+
retries: 5
4135

42-
### Wordpress service ###
4336
wp:
4437
image: wordpress_app
4538
build:
@@ -48,9 +41,9 @@ services:
4841
depends_on:
4942
- mysql
5043
environment:
51-
WORDPRESS_DB_NAME: ${DB_DATABASE}
52-
WORDPRESS_DB_USER: ${DB_USERNAME}
53-
WORDPRESS_DB_PASSWORD: ${DB_PASSWORD}
44+
WORDPRESS_DB_NAME: ${MYSQL_DATABASE}
45+
WORDPRESS_DB_USER: ${MYSQL_USER}
46+
WORDPRESS_DB_PASSWORD: ${MYSQL_PASSWORD}
5447
WORDPRESS_DB_HOST: mysql
5548
WORDPRESS_DB_CHARSET: utf8
5649
# WORDPRESS_DB_COLLATE:
@@ -72,7 +65,6 @@ services:
7265
- ./docker/wordpress/php.ini:/usr/local/etc/php/conf.d/dev.ini:ro
7366
- ./app:/var/www/html
7467

75-
### Web service ###
7668
web:
7769
image: nginx:stable-alpine
7870
depends_on:
@@ -86,8 +78,8 @@ services:
8678
- ./docker/nginx/default.conf:/etc/nginx/templates/default.conf.template:ro
8779
- ./app:/var/www/html
8880
healthcheck:
89-
test: curl --fail --silent http://127.0.0.1/_health/nginx || exit 1
90-
start_period: 2s
91-
interval: 1s
81+
test: ["CMD", "curl", "-fs", "-o", "/dev/null", "http://localhost:80/_health/nginx"]
82+
start_period: 20s
83+
interval: 5s
9284
timeout: 3s
93-
retries: 10
85+
retries: 5

docker/wordpress/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM wordpress:php7.4-fpm-alpine
1+
FROM wordpress:php8.0-fpm-alpine
22

33
# Install xdebug and Less
44
RUN set -eux; \
@@ -19,4 +19,4 @@ RUN set -eux; \
1919
php --version
2020

2121
# Install WP-CLI
22-
COPY --from=wordpress:cli-php7.4 /usr/local/bin/wp /usr/local/bin/wp
22+
COPY --from=wordpress:cli-php8.0 /usr/local/bin/wp /usr/local/bin/wp

0 commit comments

Comments
 (0)