Compare commits

..

3 Commits

Author SHA1 Message Date
Jean-Christophe Vanhalle
bbd07933ff adds monitoring instructions for restore db operation 2024-05-31 11:08:41 +02:00
Jean-Christophe Vanhalle
f86fa8b9f3 checks for checksum instead of date when syncing files 2024-05-31 11:07:44 +02:00
Jean-Christophe Vanhalle
d0a70be1b2 adds DNS so the containers can resolve public domain even when resolv.conf was created when a VPN with custom DNS server was active on host 2024-05-31 11:06:04 +02:00
3 changed files with 27 additions and 1 deletions

View File

@@ -38,7 +38,9 @@ if [ "${remote_is_docker}" != "yes" ]; then
fi
fi
if rsync --compress --delete --delete-excluded --exclude-from="${deployment_exclude_file}" --executability --human-readable --progress --update --recursive "${local_directory_path}/" "${remote_ssh_string}":"${remote_directory_path}"; then
# --update removed after kartolok-child shenaningans
# --checksum added instead
if rsync --checksum --compress --delete --delete-excluded --exclude-from="${deployment_exclude_file}" --executability --human-readable --progress --recursive "${local_directory_path}/" "${remote_ssh_string}":"${remote_directory_path}"; then
echo syncing OK
else
echo syncing NOK
@@ -53,3 +55,19 @@ if [ "${remote_is_docker}" != "yes" ]; then
exit 1
fi
fi
if [ "${remote_ssh_string}" = "staging" ]; then
set -x
ssh federal sudo service varnish restart
set +x
fi
if [ "${remote_ssh_string}" = "prod" ]; then
set -x
ssh federal sudo service varnish restart
set +x
fi
if [ "${remote_ssh_string}" = "network" ]; then
set -x
ssh network sudo service varnish restart
set +x
fi

View File

@@ -6,6 +6,8 @@ networks:
services:
adminer:
container_name: ${PREFIX}-adminer
dns:
- 1.1.1.1
hostname: ${PREFIX}-adminer
image: adminer:4.8.1-standalone
labels:
@@ -16,6 +18,8 @@ services:
- traefik.http.services.${PREFIX}-adminer.loadbalancer.server.port=8080
app:
container_name: ${PREFIX}-app
dns:
- 1.1.1.1
environment:
- PHP_POST_MAX_SIZE=${PHP_POST_MAX_SIZE}
- PHP_UPLOAD_MAX_FILESIZE=${PHP_UPLOAD_MAX_FILESIZE}
@@ -51,6 +55,8 @@ services:
traefik:
container_name: ${PREFIX}-traefik
command: ["--configFile=/etc/traefik/static/traefik.yml"]
dns:
- 1.1.1.1
image: traefik:2.5.3
labels:
- traefik.enable=true

View File

@@ -36,5 +36,7 @@ echo "dropping ${DB_NAME}"
docker exec "${PREFIX}-db" /bin/sh -c "mysqladmin --force -uroot -p${DB_ROOT_PASSWORD} drop ${DB_NAME}"
echo "creating ${DB_NAME}"
docker exec "${PREFIX}-db" /bin/sh -c "mysqladmin -uroot -p${DB_ROOT_PASSWORD} create ${DB_NAME}"
echo "run this command in another terminal/window to monitor progress:"
echo "docker exec -it watch -n1 ${PREFIX}-db du /var/lib/mysql/${DB_NAME}-sh"
echo "importing ${dump_filename_path} (${PREFIX}-db/tmp/dump.sql) into ${DB_NAME}"
docker exec "${PREFIX}-db" /bin/sh -c "mysql -uroot -p${DB_ROOT_PASSWORD} ${DB_NAME} < /tmp/dump.sql"