Skip to content

Update README.md - #31

Merged
D1m7asis merged 7 commits into
mainfrom
dev
Mar 17, 2026
Merged

D1m7asis merged 7 commits into
mainfrom
dev

Conversation

@D1m7asis

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings March 17, 2026 22:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the project README formatting to adjust spacing in the setup section before the “Project structure” header.

Changes:

  • Added an extra blank line between the final setup bullet and the “## Project structure” section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread README.md

- При проблемах с uploads - создать директорию /uploads/avatars


Copilot AI review requested due to automatic review settings March 17, 2026 22:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates deployment automation to better isolate Docker Compose stacks for staging/production and improves DB readiness handling; also includes a minor README whitespace tweak.

Changes:

  • Set explicit Docker Compose project names (-p ...) for staging and production deploys.
  • Add a Postgres readiness wait (pg_isready loop) before DB creation/migrations.
  • Minor formatting change in README.md (extra blank line).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
README.md Adds a blank line before “Project structure” (formatting only).
.github/workflows/deploy.yml Alters deploy scripts to use explicit Compose project names and wait for Postgres readiness before DB init/migrations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

set -euxo pipefail
compose_cmd='docker-compose'
compose_cmd='docker-compose -p borofone-staging'
cd /opt/borofone-chat-staging
script: |
set -euxo pipefail
compose_cmd='docker-compose'
compose_cmd='docker-compose -p borofone-prod'
rm -f deploy/docker/.env
$compose_cmd -f deploy/docker/docker-compose.staging.yml rm -sf postgres redis api || true
$compose_cmd -f deploy/docker/docker-compose.staging.yml up -d postgres redis
$compose_cmd -f deploy/docker/docker-compose.staging.yml exec -T postgres sh -lc 'until pg_isready -U "${POSTGRES_USER:-app}" -d postgres -h 127.0.0.1; do sleep 1; done'
rm -f deploy/docker/.env
$compose_cmd -f deploy/docker/docker-compose.prod.yml rm -sf postgres redis api || true
$compose_cmd -f deploy/docker/docker-compose.prod.yml up -d postgres redis
$compose_cmd -f deploy/docker/docker-compose.prod.yml exec -T postgres sh -lc 'until pg_isready -U "${POSTGRES_USER:-app}" -d postgres -h 127.0.0.1; do sleep 1; done'
Add deploy/scripts/backup-compose-data.sh to create timestamped backups (pg_dump gzipped and uploads tarball) and keep the last 10 backups per environment. Update staging and production CI steps to run the backup script before DB migrations and to perform a cleaner API rollout: stop and remove old API containers, remove lingering containers by label, then up with --force-recreate --build. Also set explicit names for volumes and networks in both docker-compose.staging.yml and docker-compose.prod.yml so persistent volumes and networks have deterministic names.
Copilot AI review requested due to automatic review settings March 17, 2026 22:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the deployment setup by introducing an automated Docker Compose data-backup script and by making Compose resource naming explicit for staging/production, alongside a minor README formatting change.

Changes:

  • Add deploy/scripts/backup-compose-data.sh to back up Postgres and the uploads Docker volume with basic retention.
  • Pin explicit name: values for volumes and networks in staging/prod Compose files.
  • Update the GitHub Actions deploy workflow to use explicit Compose project names (-p ...), stop systemd units, and run the new backup step before migrations.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
deploy/scripts/backup-compose-data.sh New script to dump DB and archive uploads volume, with timestamped backups and retention cleanup.
deploy/docker/docker-compose.staging.yml Explicitly names staging volumes and network.
deploy/docker/docker-compose.prod.yml Explicitly names prod volumes and network.
.github/workflows/deploy.yml Updates deploy logic: explicit docker-compose -p ..., stops systemd services, runs backup, and adjusts container cleanup/recreate.
README.md Adds an extra blank line (formatting-only).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +51 to +55
name: borofone-staging_postgres_data
redis_data:
name: borofone-staging_redis_data
uploads_data:
name: borofone-staging_uploads_data
Comment on lines +51 to +59
name: borofone-prod_postgres_data
redis_data:
name: borofone-prod_redis_data
uploads_data:
name: borofone-prod_uploads_data

networks:
prod_network:
name: borofone-prod_network
Comment on lines 33 to 35
set -euxo pipefail
compose_cmd='docker-compose'
compose_cmd='docker-compose -p borofone-staging'
cd /opt/borofone-chat-staging
Comment on lines +42 to +43
$compose_cmd -f deploy/docker/docker-compose.staging.yml up -d --no-recreate postgres redis
$compose_cmd -f deploy/docker/docker-compose.staging.yml exec -T postgres sh -lc 'until pg_isready -U "${POSTGRES_USER:-app}" -d postgres -h 127.0.0.1; do sleep 1; done'
$compose_cmd -f deploy/docker/docker-compose.staging.yml run --rm api alembic upgrade head
docker ps -aq --filter "name=docker_api" | xargs -r docker rm -f
$compose_cmd -f deploy/docker/docker-compose.staging.yml up -d --no-deps --build api
docker ps -q --filter "publish=8001" | xargs -r docker rm -f
Comment on lines +25 to +26
if "${compose_cmd[@]}" exec -T postgres sh -lc "psql -U \"\${POSTGRES_USER:-app}\" -d postgres -tAc \"SELECT 1 FROM pg_database WHERE datname='${db_name}'\" | grep -q 1"; then
"${compose_cmd[@]}" exec -T postgres sh -lc "pg_dump -U \"\${POSTGRES_USER:-app}\" -d \"${db_name}\" --clean --if-exists --no-owner --no-privileges" | gzip -9 > "${target_dir}/${db_name}.sql.gz"
Comment on lines 33 to +44
set -euxo pipefail
compose_cmd='docker-compose'
compose_cmd='docker-compose -p borofone-staging'
cd /opt/borofone-chat-staging
echo "[deploy] $(date -Is) start staging commit=${{ github.sha }}"
git fetch --prune origin
git checkout dev
git reset --hard origin/dev
systemctl stop borofone-staging || true
rm -f deploy/docker/.env
$compose_cmd -f deploy/docker/docker-compose.staging.yml rm -sf postgres redis api || true
$compose_cmd -f deploy/docker/docker-compose.staging.yml up -d postgres redis
$compose_cmd -f deploy/docker/docker-compose.staging.yml up -d --no-recreate postgres redis
$compose_cmd -f deploy/docker/docker-compose.staging.yml exec -T postgres sh -lc 'until pg_isready -U "${POSTGRES_USER:-app}" -d postgres -h 127.0.0.1; do sleep 1; done'
bash deploy/scripts/backup-compose-data.sh staging borofone-staging deploy/docker/docker-compose.staging.yml borofone_staging borofone-staging_uploads_data
Comment on lines 74 to 76
set -euxo pipefail
compose_cmd='docker-compose'
compose_cmd='docker-compose -p borofone-prod'
cd /opt/borofone-chat-prod
Comment on lines +83 to +84
$compose_cmd -f deploy/docker/docker-compose.prod.yml up -d --no-recreate postgres redis
$compose_cmd -f deploy/docker/docker-compose.prod.yml exec -T postgres sh -lc 'until pg_isready -U "${POSTGRES_USER:-app}" -d postgres -h 127.0.0.1; do sleep 1; done'
$compose_cmd -f deploy/docker/docker-compose.prod.yml run --rm api alembic upgrade head
docker ps -aq --filter "name=docker_api" | xargs -r docker rm -f
$compose_cmd -f deploy/docker/docker-compose.prod.yml up -d --no-deps --build api
docker ps -q --filter "publish=8000" | xargs -r docker rm -f
@D1m7asis
D1m7asis merged commit 4c288b0 into main Mar 17, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants