This is a setup designed for developers local environments. It mounts to code inside the container volumes, allowing the programmer to edit the code directly and immediately see the results. It is design to maintain a persistent database, provides an email container for full end-to-end testing, and optionally serves the phpdoc.
There are additional containers for node and composer, for convenience. This means you will not need to install
npm on the host machine.
$ cd /my/development/directory
$ git clone email@example.com:apiopenstudio/apiopenstudio.git
$ git clone firstname.lastname@example.org:apiopenstudio/apiopenstudio_admin.git
$ git clone email@example.com:apiopenstudio/apiopenstudio_docker_dev.git
$ brew install mkcert nss
$ mkcert -install
$ cd /my/development/directory/apiopenstudio_docker_dev
$ mkdir certs
$ cd certs
$ mkcert -cert-file apiopenstudio.local.crt -key-file apiopenstudio.local.key "*.apiopenstudio.local"
$ cp "$(mkcert -CAROOT)/rootCA.pem" ca.crt
/etc/hosts for your domains. Add the following lines to your
$ cp example.env .env
APP_NAME= The name of you application.
PHP_VERSION(7.4, 8.0, 8.1)
WITH_XDEBUG(true / false) - Build the PHP container with xDebug enabled.
WITH_MEMCACHED(true / false) - Build the PHP container with Memcached enabled.
WITH_REDIS(true / false) - Build the PHP container with Redis enabled.
API_CODEBASE- Full path to the API code on your host machine, e.g.
API_DOMAIN- The domain of your API
ADMIN_CODEBASE- Full path to the admin site code on your host machine, e.g.
ADMIN_DOMAIN- The domain of your admin site.
PHPDOC_DOMAIN- (optional) The domain of the phpdoc site if you want to host it.
MYSQL_HOST- The host of the Database.
MYSQL_DATABASE- The name of the database.
MYSQL_USER- The database user.
MYSQL_PASSWORD- The password for the database user.
Add the following line to
Uncomment the following line from
Uncomment the phpdoc containers in
The API, admin and php containers are configured to display the server logs in this docker directory:
$ docker-composer up -d
$ docker-composer down
Your Composer dependencies require a PHP version ">= 8.1.0".
This usually occurs when you are running when the composer image is a mismatch for the PHP version you are using.
You will need to delete the
composer.lock file and
vendor/ directory from your local ApiOpenStudio instance. and restart your containers with:
$ docker-compose down
$ docker-compose up --build
Because the DB will not be available outside of the docker network, you will need to run the install script from within the API docker:
$ docker exec -it apiopenstudio-php bash
$ cd api/