Skip to content

Refactor AnalySim Docker deployment infrastructure - #151

Open
mohab-elshamy wants to merge 2 commits into
developfrom
deployment-infrastructure
Open

Refactor AnalySim Docker deployment infrastructure#151
mohab-elshamy wants to merge 2 commits into
developfrom
deployment-infrastructure

Conversation

@mohab-elshamy

Copy link
Copy Markdown
Collaborator

Summary

This PR refactors AnalySim’s Docker deployment into a simpler, production-oriented Compose setup. It separates the ASP.NET Core backend, Angular/JupyterLite frontend, PostgreSQL database, one-shot migrations, backups, and Nginx/Certbot responsibilities into clear services, while keeping runtime configuration in a single .env file and persistent state under a user-configurable data directory.

Changes

  • Splits deployment into dedicated PostgreSQL, backend, frontend/Nginx, migration, backup, and Certbot services.
  • Adds separate Dockerfiles for the ASP.NET Core backend, Nginx frontend, and PostgreSQL backup service.
  • Moves Angular and JupyterLite builds into the frontend/Nginx image.
  • Keeps the backend image .NET-only and safe to publish without baked production secrets.
  • Adds a one-shot EF Core migration container.
  • Serves Angular/JupyterLite static files directly from Nginx and reverse-proxies /api/ to the backend.
  • Simplifies runtime configuration to a single .env file.
  • Keeps persistent data, backups, and certificates under a user-configurable ANALYSIM_DATA_ROOT.
  • Updates deployment documentation and removes obsolete legacy Docker files.

Minimal Deploy Steps

cp .env.example .env
# edit .env: ANALYSIM_DATA_ROOT, domain, DB password/connection string, JWT secret, email settings

export ANALYSIM_DATA_ROOT=/path/to/persistent/analysim-data
mkdir -p "$ANALYSIM_DATA_ROOT"/{postgres/data,postgres/certs,backups,certbot/conf,certbot/www}

# add PostgreSQL TLS cert/key under:
# $ANALYSIM_DATA_ROOT/postgres/certs/server.crt
# $ANALYSIM_DATA_ROOT/postgres/certs/server.key

docker compose --env-file .env build
docker compose --env-file .env up -d

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.

1 participant