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

feat: PHP SPX #820

Open
wants to merge 3 commits into
base: main
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
3 changes: 3 additions & 0 deletions commands/env.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ fi
[[ ${WARDEN_MAGEPACK} -eq 1 ]] \
&& appendEnvPartialIfExists "${WARDEN_ENV_TYPE}.magepack"

[[ ${WARDEN_PHP_SPX} -eq 1 ]] \
&& appendEnvPartialIfExists "php-spx"

if [[ -f "${WARDEN_ENV_PATH}/.warden/warden-env.yml" ]]; then
DOCKER_COMPOSE_ARGS+=("-f")
DOCKER_COMPOSE_ARGS+=("${WARDEN_ENV_PATH}/.warden/warden-env.yml")
Expand Down
4 changes: 3 additions & 1 deletion commands/shell.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ loadEnvConfig "${WARDEN_ENV_PATH}" || exit $?
## set defaults for this command which can be overridden either using exports in the user
## profile or setting them in the .env configuration on a per-project basis
WARDEN_ENV_SHELL_COMMAND=${WARDEN_ENV_SHELL_COMMAND:-bash}
WARDEN_ENV_SHELL_CONTAINER=${WARDEN_ENV_SHELL_CONTAINER:-php-fpm}

WARDEN_ENV_DEFAULT_SHELL_CONTAINER=$([ $WARDEN_PHP_SPX == 1 ] && echo "php-spx" || echo "php-fpm")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SamJUK I don't fully agree with this. The warden shell goes to the standard php-fpm container and warden debug goes to php-debug container. To me this would seem like we could either add a flag --spx or create a new warden spx command to drop to a shell in it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also prefer having warden spx command, similar to warden debug

WARDEN_ENV_SHELL_CONTAINER=${WARDEN_ENV_SHELL_CONTAINER:-$WARDEN_ENV_DEFAULT_SHELL_CONTAINER}

## allow return codes from sub-process to bubble up normally
trap '' ERR
Expand Down
1 change: 1 addition & 0 deletions environments/drupal/init.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ PHP_XDEBUG_3=1
WARDEN_DB=1
WARDEN_RABBITMQ=0
WARDEN_REDIS=0
WARDEN_PHP_SPX=0

RABBITMQ_VERSION=3.8

Expand Down
26 changes: 26 additions & 0 deletions environments/includes/php-spx.base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
x-volumes: &volumes
- ${WARDEN_SSL_DIR}/rootca/certs:/etc/ssl/warden-rootca-cert:ro
- ${WARDEN_COMPOSER_DIR}:/home/www-data/.composer:cached
- .${WARDEN_WEB_ROOT:-}/:/var/www/html:cached
- bashhistory:/bash_history
- sshdirectory:/home/www-data/.ssh

x-extra_hosts: &extra_hosts
- ${TRAEFIK_DOMAIN}:${TRAEFIK_ADDRESS:-0.0.0.0}
- ${TRAEFIK_SUBDOMAIN:-app}.${TRAEFIK_DOMAIN}:${TRAEFIK_ADDRESS:-0.0.0.0}

services:
php-spx:
hostname: "${WARDEN_ENV_NAME}-php-spx"
image: ${WARDEN_IMAGE_REPOSITORY}/php-fpm${WARDEN_SVC_PHP_IMAGE_SUFFIX:-}:${PHP_VERSION:-7.4}-spx
environment:
- TRAEFIK_DOMAIN
- TRAEFIK_SUBDOMAIN
- SSH_AUTH_SOCK=${SSH_AUTH_SOCK_PATH_ENV:-/tmp/ssh-auth.sock}
- NODE_VERSION=${NODE_VERSION:-12}
- COMPOSER_VERSION=${COMPOSER_VERSION:-1}
- COMPOSER_MEMORY_LIMIT=-1
- HISTFILE=/bash_history/.bash_history
- CHOWN_DIR_LIST=${CHOWN_DIR_LIST:-}
volumes: *volumes
extra_hosts: *extra_hosts
1 change: 1 addition & 0 deletions environments/laravel/init.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ REDIS_VERSION=5.0

WARDEN_DB=1
WARDEN_REDIS=1
WARDEN_PHP_SPX=0

## Laravel Config
APP_URL=http://app.$WARDEN_ENV_NAME.test
Expand Down
1 change: 1 addition & 0 deletions environments/magento1/init.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

WARDEN_DB=1
WARDEN_REDIS=1
WARDEN_PHP_SPX=0

MYSQL_DISTRIBUTION=mariadb
MYSQL_DISTRIBUTION_VERSION=10.3
Expand Down
1 change: 1 addition & 0 deletions environments/magento2/init.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ WARDEN_ELASTICHQ=0
WARDEN_VARNISH=1
WARDEN_RABBITMQ=1
WARDEN_REDIS=1
WARDEN_PHP_SPX=0

OPENSEARCH_VERSION=2.12
MYSQL_DISTRIBUTION=mariadb
Expand Down
1 change: 1 addition & 0 deletions environments/shopware/init.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ WARDEN_REDIS=1
WARDEN_RABBITMQ=0
WARDEN_ELASTICSEARCH=0
WARDEN_VARNISH=0
WARDEN_PHP_SPX=0

MYSQL_DISTRIBUTION=mariadb
MYSQL_DISTRIBUTION_VERSION=10.4
Expand Down
1 change: 1 addition & 0 deletions environments/symfony/init.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ WARDEN_REDIS=1
WARDEN_RABBITMQ=0
WARDEN_ELASTICSEARCH=0
WARDEN_VARNISH=0
WARDEN_PHP_SPX=0

MYSQL_DISTRIBUTION=mariadb
MYSQL_DISTRIBUTION_VERSION=10.4
Expand Down
1 change: 1 addition & 0 deletions environments/wordpress/init.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ PHP_XDEBUG_3=1

WARDEN_DB=1
WARDEN_REDIS=0
WARDEN_PHP_SPX=0

APP_ENV=local
APP_DEBUG=true
Expand Down