Edit the file: .env.docker
(The following steps are copied from this online documentation)
- Recommendation: use OrbStack instead of Docker Desktop for Mac!
Start container with all services.
- in "detached mode" - without interative log in the Shell
cd /path/to/zorg-code/
docker compose --project-directory ./ --file ./Docker/docker-compose.yml --env-file ./Docker/.env.docker up -d
- or with an interactive log in the Shell
cd /path/to/zorg-code/
docker compose --project-directory ./ --file ./Docker/docker-compose.yml --env-file ./Docker/.env.docker up
The MySQL database host name is zorg-db
and needs be added to the PHP environment config file /www/.env
.
Edit the msmtprc config file in the ./Docker/sendmail/
directory and replace the following placeholders with real values:
- SMTP_HOST => mail.mymailserver.com
- SMTP_EMAIL => [email protected]
- SMTP_PASSWORD => password for your SMTP_EMAIL account
Further details on the sendmail / msmtprc integration can be found here: Send email on testing docker container with php and sendmail
…or with a hosts entry pointing to 127.0.0.1
and SSL: https://zorg.local/
…or with a hosts entry pointing to 127.0.0.1
: http://zorg.local:8080/
- Server: use the Docker's
zorg-db
-service hostname or IP-address - Username: use the defined
MYSQL_USER
-environment value - Password: use the defined
MYSQL_PASSWORD
-environment value
The best way is to import an SQL-dump using the phpmysql Docker service at http://localhost:8080/.
Alternatively the path to a local database folder can be provided by overriding the ENV var MYSQL_LOCAL_DATABASE_PATH
:
MYSQL_LOCAL_DATABASE_PATH=/path/to/my/mysql57 docker compose --project-directory ./ --file ./Docker/docker-compose.yml --env-file ./Docker/.env.docker up -d
To fix the MySQL-Error 1812 Tablespace is missing for table zooomclan . <table-name>
try the following command per affected <table-name>
:
ALTER TABLE zooomclan.<table-name> IMPORT TABLESPACE
Find IP of a container service (can also be seen in the network details)
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' SERVICENAME
Inspect all running Docker services
docker ps
Inspect all container service details
docker container inspect SERVICENAME
Inspect a container's network details
docker network inspect CONTAINER_NETWORKNAME
Execute a shell command on a container service
docker exec -it SERVICENAME ls -la
- Example: show apache2's
000-default.conf
file:
docker exec -it zorg-web cat /etc/apache2/sites-available/000-default.conf
Enter into interactive shell mode for a container service
docker exec -it SERVICENAME sh
List all Environment Variables for a container service
docker exec SERVICENAME env
!! Refresh docker-sync after updating the docker-compose.yml
-file
docker-sync clean
Inspect running docker-sync services:
docker volume ls | grep -sync
Inspect the logfile for sendmail / msmtprc:
docker exec -it zorg-web cat /var/log/sendmail.log
docker-sync
greatly improves the performance of synced volumes from the local file system to Docker, giving a nearly live-performance for read/write operations.
gem install --user-install docker-sync
brew install fswatch
brew install unison
brew install eugenmayer/dockersync/unox
Docker sync requires a valid configuration file (docker-sync.yaml), the below file creates a named volume for Docker called osx-sync and mounts the local macOS directory.
Add docker-sync
to your $PATH using nano ~/.zshrc
if which ruby >/dev/null && which gem >/dev/null; then
PATH="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin:$PATH"
fi
Now run source ~/.zshrc
to apply the $PATH settings.
Here's an example docker-sync
YAML configuration:
version: "2"
options:
config_path: './../'
compose-file-path: './docker-compose.yml'
verbose: true
syncs:
# sync_strategy: see https://docker-sync.readthedocs.io/en/latest/getting-started/configuration.html#sync-strategy
zorg-web-root-git-sync:
src: './.git'
sync_strategy: 'unison'
zorg-web-root-data-sync:
src: './data'
sync_strategy: 'unison'
#sync_excludes: [ ]
zorg-web-root-vendor-sync:
src: './vendor'
sync_strategy: 'unison'
# sync_host_ip: 'auto'
# sync_host_port: 10873
sync_excludes: [ ]
zorg-web-root-www-sync:
src: './www'
sync_strategy: 'unison'
sync_excludes: [ ]
zorg-db-mysql-sync:
src: './Docker/mysql57'
sync_strategy: 'unison'
sync_excludes: [ ]
Start container with all services.
- in "detached mode" - without interative log in the Shell
cd /path/to/zorg-code/
docker-sync start -c ./Docker/docker-sync.yml
docker compose --project-directory ./ --file ./Docker/docker-compose.yml --env-file ./Docker/.env.docker up -d