Repository navigation
Refactor AnalySim Docker deployment infrastructure - #151
mohab-elshamy wants to merge 2 commits into
Conversation
cengique
left a comment
There was a problem hiding this comment.
Thanks for providing such a comprehensive overhaul of the deployment system. I see many good features, but I also have some suggestions to fix.
I marked some suggestions specifically, but I got stuck in the first Docker run for getting the Let's Encrypt cert:
$ sudo docker run --rm -v "$ANALYSIM_DATA_ROOT/certbot/conf:/etc/letsencrypt" -v "$ANALYSIM_DATA_ROOT/certbot/www:/var/www/certbot" certbot/certbot certonly --webroot --webroot-path /var/www/certbot -d "localhost"
[sudo] password for cengiz:
Unable to find image 'certbot/certbot:latest' locally
latest: Pulling from certbot/certbot
e6f31ffc071e: Pull complete
9010581fffd4: Pull complete
bfac9e75463e: Pull complete
426f169c5b37: Pull complete
500b30537bf5: Pull complete
c37269114a8b: Pull complete
5e4ba5eb6a5b: Pull complete
0c77a7cefcb3: Pull complete
f1e126553701: Pull complete
bb95bb741cc3: Pull complete
cc6a5902e005: Pull complete
Digest: sha256:f70ad0adbb7e117f0fe42a63c553f28ea451edabc0148757b6efcd9735acaa20
Status: Downloaded newer image for certbot/certbot:latest
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Skipped user interaction because Certbot doesn't appear to be running in a terminal. You should probably include --non-interactive or --force-interactive on the command line.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at:
https://letsencrypt.org/documents/LE-SA-v1.8-July-06-2026.pdf
You must agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: An unexpected error occurred:
EOFError
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
| POSTGRES_USER=analysim | ||
| POSTGRES_PASSWORD=replace-with-a-long-random-password | ||
|
|
||
| DB_CONNECTION_STRING=User ID=analysim;Password=replace-with-a-long-random-password;Server=postgres;Port=5432;Database=analysim;Pooling=true;SSL Mode=Require;Trust Server Certificate=true |
There was a problem hiding this comment.
If we already provide the POSTGRES variables above, the connection string is redundant. Either remove this or the previous variables.
| ANALYSIM_DOMAIN=localhost | ||
| ANALYSIM_IMAGE_TAG=latest | ||
|
|
||
| TLS_CERT_PATH=/etc/letsencrypt/live/localhost/fullchain.pem |
There was a problem hiding this comment.
I thought these were under the data/ folder according to the README
| JWT_ISSUER=AnalySim | ||
| JWT_AUDIENCE=https://localhost | ||
| JWT_SECRET=replace-with-a-long-random-secret | ||
| CLIENT_BASE_URL=https://localhost |
There was a problem hiding this comment.
isn't this the same as DOMAIN above? or is this only for local runs?
| CLIENT_BASE_URL=https://localhost | ||
| ALLOWED_HOSTS=* | ||
| ADMIN_USER=ADMIN | ||
| REGISTRATION_CODE=replace-with-registration-code |
There was a problem hiding this comment.
we may have more than one registration code
| Expected layout: | ||
|
|
||
| ```text | ||
| $ANALYSIM_DATA_ROOT/ |
There was a problem hiding this comment.
we may need some of these to be automatically created
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
.envfile and persistent state under a user-configurable data directory.Changes
/api/to the backend..envfile.ANALYSIM_DATA_ROOT.Minimal Deploy Steps