This image was created for the divblox and sDev frameworks at stratuSolve.
It is based on the php:**-apache image and has everything you need to run the application.
This image contains the following:
sudo usermod -aG docker $USER to achieve this.
customdomain.sdev.local {
reverse_proxy sdev:80
tls internal
}
version: '3'
services:
caddy:
image: caddy:latest
ports:
- 80:80
- 443:443
- 443:443/udp
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
sdev:
image: johanmarx/stratusolve_php_apache:latest
volumes:
- ./src:/var/www/html/ #bind your source
extra_hosts:
- customdomain.sdev.local:host-gateway
environment:
- SERVER_INSTANCE=container
- BEHIND_SECURE_GATEWAY=1
- ALLOW_REMOTE_ADMIN=1
- DEV_MODE=1
- DB_SERVER=sql
- DB_NAME=dxdatabase
- DB_USERNAME=dxuser
- DB_PASSWORD=secret
- MAINTENANCE_PASS=123
- NON_PROD_INDICATOR=Top
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=123
- PHP_SESSION_HANDLER=files
- PHP_SESSION_PATH=/tmp
sql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: 'secret'
MYSQL_USER: 'dxuser'
MYSQL_PASSWORD: 'secret'
MYSQL_DATABASE: 'dxdatabase'
volumes:
- mysql8data:/var/lib/mysql
command:
- --default-authentication-plugin=caching_sha2_password
- --lower_case_table_names=1
- --sql_mode=
ports:
- 3306:3306
redis:
image: redis:latest
ports:
- 6379:6379
command: redis-server --save 60 10 --requirepass 123
volumes:
- reddis_data:/data
volumes:
mysql8data: {}
caddy_data: {}
caddy_config: {}
reddis_data: {}
customdomain.divblox.local {
reverse_proxy divblox:80
tls internal
}
version: "3"
services:
caddy:
image: caddy:latest
ports:
- 80:80
- 443:443
- 443:443/udp
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
divblox:
image: johanmarx/stratusolve_php_apache:latest
volumes:
- ./src:/var/www/html/ #bind your source
environment:
- CONTAINER=1
- BEHIND_SECURE_GATEWAY=1
- DB_SERVER=sql
- DB_PORT=3306
- DB_NAME=dxdatabase
- DB_USERNAME=dxuser
- DB_PASSWORD=secret
- MAINTENANCE_USERNAME=admin
- MAINTENANCE_PASSWORD=123
- REDIS_STATE=1
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=123
- DX_API_KEY=adummyapikey
- PHP_SESSION_HANDLER=memcached
- PHP_SESSION_PATH=memcached:11211
extra_hosts:
- customdomain.divblox.local:host-gateway
sql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: "secret"
MYSQL_USER: "dxuser"
MYSQL_PASSWORD: "secret"
MYSQL_DATABASE: "dxdatabase"
volumes:
- mysql8data:/var/lib/mysql
command:
- --default-authentication-plugin=caching_sha2_password
- --lower_case_table_names=1
- --sql_mode=
ports:
- 3306:3306
redis:
image: redis:latest
ports:
- 6379:6379
command: redis-server --save 60 10 --requirepass 123
volumes:
- reddis_data:/data
memcached:
image: memcached:1.6.22-alpine
ports:
- 11211:11211
volumes:
mysql8data: {}
caddy_data: {}
caddy_config: {}
reddis_data: {}
You can navigate to your machine's hosts file, then add the following lines based on the framework:
127.0.0.1 customdomain.divblox.local
127.0.0.1 customdomain.sdev.local
You might have to restart after this for it to take effect.
You can ping the domain to check that you get responses from 127.0.0.1
ping customdomain.divblox.local
Linux
/etc/hosts
macOS
/private/etc/hosts
Windows:
c:\windows\system32\drivers\etc\hosts.file
You must use one of the following sets of environment variables to define where your PHP sessions are managed.
Note that this has to correspond with the rest of your setup.
PHP_SESSION_HANDLER=memcached
PHP_SESSION_PATH=memcached:11211
PHP_SESSION_HANDLER=redis
PHP_SESSION_PATH=tcp://redis:6379?auth=123
Temporary File (old default, all sessions lost on app container restart)
PHP_SESSION_HANDLER=files
PHP_SESSION_PATH=/tmp
You can use Xdebug to debug your application. By using an Xdebug Dockerfile and a new php.ini you can build an image to replace this base image.
FROM johanmarx/stratusolve_php_apache:latest
COPY ./xdebug.ini "$PHP_INI_DIR/conf.d"
[xdebug]
zend_extension=xdebug
xdebug.mode=develop,debug
xdebug.start_with_request=yes
xdebug.discover_client_host=0
xdebug.client_host=host.docker.internal
xdebug.client_port=9003
service_name:
build:
context: .
dockerfile: Xdebug.Dockerfile
image: customxdebugimage
# image: johanmarx/stratusolve_php_apache:latest
volumes:
- ./src:/var/www/html
extra_hosts:
- host.docker.internal:host-gateway #important
- ...
env_file:
- local.env
You can then listen for debug connections on VSCode or PhpStorm on port 9003.
Content type
Image
Digest
sha256:ca6763b1e…
Size
302.1 MB
Last updated
over 1 year ago
docker pull johanmarx/stratusolve_php_apache