Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added PUBLIC_DIR argument to customise web directory #5

Open
wants to merge 1 commit into
base: 1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ By default, MySQL and Mailhog containers will be attached, but you can also use,
wp sail:install --with=mysql,mailhog,redis
```

## PHP Versions
At this point, you may want to change the version of PHP used in the `docker-compose.yml` file.

```
Expand All @@ -54,6 +55,21 @@ services:
# ...
```

## Alternative Public Path
If your WordPress files are in a `web/` directory in your repository then you're good to go - otherwise set the PUBLIC_DIR arg in `docker-compose.yaml`.

```
version: '3'
services:
wordpress.test:
build:
context: ./vendor/sterner-stuff/wordpress-sail/runtimes/8.1
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
PUBLIC_DIR: 'public' <-- path to the directory containing wp-config.php relative to your docker-compose.yaml file
# ...
```
Finally, build your containers:

```
Expand Down
2 changes: 2 additions & 0 deletions runtimes/7.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ LABEL maintainer="Taylor Otwell"

ARG WWWGROUP
ARG NODE_VERSION=16
ARG PUBLIC_DIR=web

WORKDIR /var/www/html

ENV DEBIAN_FRONTEND noninteractive
ENV TZ=UTC
ENV ABSPATH "/var/www/html/$PUBLIC_DIR"

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

Expand Down
2 changes: 1 addition & 1 deletion runtimes/7.4/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid

[program:php]
command=wp server --docroot=/var/www/html/web/ --host=0.0.0.0 --port=80
command=wp server --docroot=%(ENV_ABSPATH)s --host=0.0.0.0 --port=80
user=sail
environment=LARAVEL_SAIL="1"
stdout_logfile=/dev/stdout
Expand Down
2 changes: 2 additions & 0 deletions runtimes/8.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ LABEL maintainer="Taylor Otwell"

ARG WWWGROUP
ARG NODE_VERSION=16
ARG PUBLIC_DIR=web

WORKDIR /var/www/html

ENV DEBIAN_FRONTEND noninteractive
ENV TZ=UTC
ENV ABSPATH "/var/www/html/$PUBLIC_DIR"

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

Expand Down
2 changes: 1 addition & 1 deletion runtimes/8.0/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid

[program:php]
command=wp server --docroot=/var/www/html/web/ --host=0.0.0.0 --port=80
command=wp server --docroot=%(ENV_ABSPATH)s --host=0.0.0.0 --port=80
user=sail
environment=LARAVEL_SAIL="1"
stdout_logfile=/dev/stdout
Expand Down
2 changes: 2 additions & 0 deletions runtimes/8.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ LABEL maintainer="Taylor Otwell"

ARG WWWGROUP
ARG NODE_VERSION=16
ARG PUBLIC_DIR=web

WORKDIR /var/www/html

ENV DEBIAN_FRONTEND noninteractive
ENV TZ=UTC
ENV ABSPATH "/var/www/html/$PUBLIC_DIR"

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

Expand Down
2 changes: 1 addition & 1 deletion runtimes/8.1/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid

[program:php]
command=wp server --docroot=/var/www/html/web/ --host=0.0.0.0 --port=80
command=wp server --docroot=%(ENV_ABSPATH)s --host=0.0.0.0 --port=80
user=sail
environment=LARAVEL_SAIL="1"
stdout_logfile=/dev/stdout
Expand Down