Changeset View
Changeset View
Standalone View
Standalone View
bin/quickstart.sh
Show All 10 Lines | rpm -qv docker-compose >/dev/null 2>&1 || \ | ||||
test ! -z "$(which docker-compose 2>/dev/null)" || \ | test ! -z "$(which docker-compose 2>/dev/null)" || \ | ||||
die "Is docker-compose installed?" | die "Is docker-compose installed?" | ||||
test ! -z "$(grep 'systemd.unified_cgroup_hierarchy=0' /proc/cmdline)" || \ | test ! -z "$(grep 'systemd.unified_cgroup_hierarchy=0' /proc/cmdline)" || \ | ||||
die "systemd containers only work with cgroupv1 (use 'grubby --update-kernel=ALL --args=\"systemd.unified_cgroup_hierarchy=0\"' and a reboot to fix)" | die "systemd containers only work with cgroupv1 (use 'grubby --update-kernel=ALL --args=\"systemd.unified_cgroup_hierarchy=0\"' and a reboot to fix)" | ||||
base_dir=$(dirname $(dirname $0)) | base_dir=$(dirname $(dirname $0)) | ||||
# Always reset .env with .env.example | |||||
cp src/.env.example src/.env | |||||
if [ -f "src/env.local" ]; then | |||||
# Ensure there's a line ending | |||||
echo "" >> src/.env | |||||
cat src/env.local >> src/.env | |||||
fi | |||||
export DOCKER_BUILDKIT=0 | export DOCKER_BUILDKIT=0 | ||||
COMPOSE_ARGS= | |||||
if [ "$1" != "--nodev" ]; then | |||||
COMPOSE_ARGS="-f docker-compose.yml -f docker-compose.local.yml" | |||||
fi | |||||
docker-compose down --remove-orphans | docker-compose down --remove-orphans | ||||
docker volume rm kolab_mariadb || : | docker volume rm kolab_mariadb || : | ||||
docker volume rm kolab_imap || : | docker volume rm kolab_imap || : | ||||
docker volume rm kolab_ldap || : | docker volume rm kolab_ldap || : | ||||
if [ "$1" != "--nodev" ]; then | # We can't use the following artisan commands because it will just block if redis is unavailable: | ||||
src/artisan octane:stop >/dev/null 2>&1 || : | # src/artisan octane:stop >/dev/null 2>&1 || : | ||||
src/artisan horizon:terminate >/dev/null 2>&1 || : | # src/artisan horizon:terminate >/dev/null 2>&1 || : | ||||
else | # we therefore just kill all artisan processes running. | ||||
# If we switch from an existing development setup to a compose deployment, | |||||
# we don't have a nice way to terminate octane/horizon. | |||||
# We can't use the artisan command because it will just block if redis is, | |||||
# no longer available, so we just kill all artisan processes running. | |||||
pkill -9 -f artisan || : | pkill -9 -f artisan || : | ||||
fi | pkill -9 -f swoole || : | ||||
bin/regen-certs | bin/regen-certs | ||||
docker-compose build coturn kolab mariadb meet pdns proxy redis haproxy | docker-compose build coturn kolab mariadb meet pdns proxy redis haproxy | ||||
docker-compose ${COMPOSE_ARGS} up -d coturn kolab mariadb meet pdns redis | docker-compose up -d coturn kolab mariadb meet pdns redis | ||||
# Workaround until we have docker-compose --wait (https://github.com/docker/compose/pull/8777) | # Workaround until we have docker-compose --wait (https://github.com/docker/compose/pull/8777) | ||||
function wait_for_container { | function wait_for_container { | ||||
container_id="$1" | container_id="$1" | ||||
container_name="$(docker inspect "${container_id}" --format '{{ .Name }}')" | container_name="$(docker inspect "${container_id}" --format '{{ .Name }}')" | ||||
echo "Waiting for container: ${container_name} [${container_id}]" | echo "Waiting for container: ${container_name} [${container_id}]" | ||||
waiting_done="false" | waiting_done="false" | ||||
while [[ "${waiting_done}" != "true" ]]; do | while [[ "${waiting_done}" != "true" ]]; do | ||||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | |||||
./artisan db:ping --wait | ./artisan db:ping --wait | ||||
php -dmemory_limit=512M ./artisan migrate:refresh --seed | php -dmemory_limit=512M ./artisan migrate:refresh --seed | ||||
./artisan data:import || : | ./artisan data:import || : | ||||
nohup ./artisan octane:start --host=$(grep OCTANE_HTTP_HOST .env | tail -n1 | sed "s/OCTANE_HTTP_HOST=//") > octane.out & | nohup ./artisan octane:start --host=$(grep OCTANE_HTTP_HOST .env | tail -n1 | sed "s/OCTANE_HTTP_HOST=//") > octane.out & | ||||
nohup ./artisan horizon > horizon.out & | nohup ./artisan horizon > horizon.out & | ||||
popd | popd | ||||
docker-compose ${COMPOSE_ARGS} up --no-deps -d proxy haproxy | docker-compose up --no-deps -d proxy haproxy |