Repository navigation
Restarting all Environments
A clean restart of the server phase in this order:
development → test → production → edge Caddy → smoke tests
The key thing is ensure the following Compose project names:
ers-dev
ers-tst
ers-prd
From the server:
cd /opt/EnterpriseRemoteSystems/developmentPull latest code:
Assuming the your repository's development branch has the lasted updates and that /opt/EnterpriseRemoteSystems/development a project clone, with development as the current branch"
git pullClean up any old dev stack variants:
docker compose \
-p enterpriseremotesystems-dev \
--env-file .env.development \
-f docker-compose.server.yml \
down 2>/dev/null || true
docker compose \
-p ers-dev \
--env-file .env.development \
-f docker-compose.server.yml \
down 2>/dev/null || trueInitialize env if needed:
make server-init-env ENV=development SERVER_ROOT=/opt/EnterpriseRemoteSystemsBuild and start:
make server-dev-build SERVER_ROOT=/opt/EnterpriseRemoteSystems
make server-dev-up SERVER_ROOT=/opt/EnterpriseRemoteSystemsVerify containers:
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" | grep ers-devExpected:
ers-dev-backend Up ... healthy
ers-dev-frontend Up ...
ers-dev-caddy Up ...Verify network:
docker network ls | grep ers-devExpected:
ers-dev_defaultTest internally:
docker run --rm --network ers-dev_default curlimages/curl:latest \
-i http://ers-dev-caddy/api/v1/healthzExpected:
HTTP/1.1 200 OK
Do not continue to test until development passes this internal Caddy health check.
Pull latest code:
Assuming the your repository's development branch has the lasted updates and that /opt/EnterpriseRemoteSystems/test has a project clone, with test as the current branch"
cd /opt/EnterpriseRemoteSystems/test
git pullClean old wrong stack:
docker compose \
-p enterpriseremotesystems-tst \
--env-file .env.test \
-f docker-compose.server.yml \
down 2>/dev/null || true
docker compose \
-p ers-tst \
--env-file .env.test \
-f docker-compose.server.yml \
down 2>/dev/null || trueInitialize env if needed:
make server-init-env ENV=test SERVER_ROOT=/opt/EnterpriseRemoteSystemsBuild and start:
make server-test-build SERVER_ROOT=/opt/EnterpriseRemoteSystems
make server-test-up SERVER_ROOT=/opt/EnterpriseRemoteSystemsVerify:
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" | grep ers-tst
docker network ls | grep ers-tstExpected network:
ers-tst_default
Internal test:
docker run --rm --network ers-tst_default curlimages/curl:latest \
-i http://ers-tst-caddy/api/v1/healthzExpected:
HTTP/1.1 200 OKAssuming the your repository's development branch has the lasted updates and that /opt/EnterpriseRemoteSystems/production has a project clone, with production as the current branch"
cd /opt/EnterpriseRemoteSystems/production
git checkout production
git pull --ff-only origin productionClean old wrong stack:
docker compose \
-p enterpriseremotesystems-prd \
--env-file .env.production \
-f docker-compose.server.yml \
down 2>/dev/null || true
docker compose \
-p ers-prd \
--env-file .env.production \
-f docker-compose.server.yml \
down 2>/dev/null || trueInitialize env if needed:
make server-init-env ENV=production SERVER_ROOT=/opt/EnterpriseRemoteSystemsBuild and start:
make server-prod-build SERVER_ROOT=/opt/EnterpriseRemoteSystems
make server-prod-up SERVER_ROOT=/opt/EnterpriseRemoteSystemsVerify:
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" | grep ers-prd
docker network ls | grep ers-prdExpected network:
ers-prd_defaultInternal test:
docker run --rm --network ers-prd_default curlimages/curl:latest \
-i http://ers-prd-caddy/api/v1/healthzExpected:
HTTP/1.1 200 OKRun:
docker network ls | grep ersExpected:
ers-dev_default
ers-tst_default
ers-prd_defaultAlso confirm old wrong networks are gone or unused:
docker network ls | grep enterpriseremotesystems
docker network ls | grep reverse-proxyIf you see old networks and no containers are attached, remove them later. Not necessary before edge startup unless they own ports or confuse routing.
First remove the old public Caddy if it still exists:
docker stop collaborator-caddy 2>/dev/null || true
docker rm collaborator-caddy 2>/dev/null || trueThen:
cd /opt/EnterpriseRemoteSystems/development
make edge-up SERVER_ROOT=/opt/EnterpriseRemoteSystemsVerify:
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" | grep caddyExpected:
ers-dev-caddy Up ... 80/tcp, ...
ers-tst-caddy Up ... 80/tcp, ...
ers-prd-caddy Up ... 80/tcp, ...
ers-edge-caddy Up ... 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, ...Confirm edge is attached to all three networks:
docker network inspect ers-dev_default \
--format '{{range $id, $c := .Containers}}{{$c.Name}}{{"\n"}}{{end}}'
docker network inspect ers-tst_default \
--format '{{range $id, $c := .Containers}}{{$c.Name}}{{"\n"}}{{end}}'
docker network inspect ers-prd_default \
--format '{{range $id, $c := .Containers}}{{$c.Name}}{{"\n"}}{{end}}'Each should include:
ers-edge-caddyplus the corresponding environment Caddy.
Run:
curl -i https://dev.enterpriseremotesystems.com/api/v1/healthz
curl -i https://tst.enterpriseremotesystems.com/api/v1/healthz
curl -i https://app.enterpriseremotesystems.com/api/v1/healthzThen:
make server-dev-smoke SERVER_ROOT=/opt/EnterpriseRemoteSystems
make server-test-smoke SERVER_ROOT=/opt/EnterpriseRemoteSystems
make server-prod-smoke SERVER_ROOT=/opt/EnterpriseRemoteSystemsStop at the first failure and inspect the relevant logs:
docker logs ers-dev-backend --tail=100
docker logs ers-dev-caddy --tail=100
docker logs ers-edge-caddy --tail=100For test/production, replace dev with tst or prd.