Hello,
I have added OpenSearch to my project and am using it in one of my new microservices. For the data I use a docker volume. In ABP Studio when I stop or restart the OpenSearch container or the new microservice, the volume still exists. When I stop all containers it deletes all volumes.
Is it possible to not delete the volumes or atleast not the OpenSearch volume when I stop all containers? We're importing and indexing about 15 million datasets and even when I only import a part of it, it takes a long time. That's why I want the volume to persist.
My docker compose file:
volumes:
meinwerk_opensearchdata:
networks:
meinwerk:
external: true
services:
opensearch:
container_name: opensearch
image: opensearchproject/opensearch:2.19.0
volumes:
- meinwerk_opensearchdata:/usr/share/opensearch/data
networks:
- meinwerk
environment:
- discovery.type=single-node
- DISABLE_INSTALL_DEMO_CONFIG=true
- DISABLE_SECURITY_PLUGIN=true
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
- bootstrap.memory_lock=true
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
ports:
- "9201:9200"
My down.ps1:
docker-compose -f containers/elasticsearch.yml down
docker-compose -f containers/opensearch.yml down
docker-compose -f containers/kibana.yml down
docker-compose -f containers/prometheus.yml down
docker-compose -f containers/rabbitmq.yml down
docker-compose -f containers/redis.yml down
exit $LASTEXITCODE
Current solution configuration:
- Template: microservice
- Template Type: Modern
- Created ABP Studio Version: 3.0.3
- Current ABP Studio Version: 3.0.6
- Multi-Tenancy: Yes
- UI Framework: react
- Theme: leptonx
- Theme Style: system
- Theme Menu Placement: side
- Database Provider: ef
- Database Management System: postgresql
- Mobile Framework: none
- Public Website: No
- Social Login: Yes
- Include Tests: Yes
- Dynamic Localization: Yes
- Kubernetes Configuration: Yes
- Grafana Dashboard: Yes
- Use Local References: No
- Aspire: No
- Optional Modules:
- GDPR
- TextTemplateManagement
- AuditLogging
- OpenIddictAdmin
- Selected Languages: English, Arabic, Chinese (Simplified), Chinese (Traditional), Czech, English (UK), Finnish, French, German (Germany), Hindi , Hungarian, Icelandic, Italian, Portuguese (Brazil), Romanian (Romania), Russian, Slovak, Spanish, Swedish, Turkish
- Default Language: English
- Create Command: abp new Aevwl.MeinWerk -t microservice --ui-framework react --database-provider ef --database-management-system postgresql --theme leptonx --skip-migration --skip-migrator --without-cms-kit --dont-run-install-libs -no-file-management -no-language-management
2 Answer(s)
-
0
- ABP Studio stops Docker containers by executing
docker-compose down(see the ABP Studio MCP “Container Control” notes). In Docker Compose, volumes are only removed ifdownis executed with-v/--volumes. So, if your volumes are being deleted when you click “Stop All”, ABP Studio is effectively running a “down that removes volumes” for that bulk operation (or running an additional cleanup step after stopping). - Workaround (recommended): don’t use “Stop All” for your data-heavy services. Instead, stop containers individually (as you already noticed, volumes remain), or run your own stop script/task that does not remove volumes.
Make your OpenSearch data survive “Stop All” (robust workaround)
Convert the named volume to an external volume so Compose (and any
down -v) won’t remove it automatically:volumes: meinwerk_opensearchdata: external: trueThen create it once:
docker volume create meinwerk_opensearchdataWith
external: true, Compose treats it as pre-existing infrastructure and won’t delete it as part ofdowncleanup.Also check your own scripts
Your posted
down.ps1uses plaindocker-compose ... down(no-v), which should not remove volumes. So the volume deletion behavior is coming from ABP Studio’s bulk stop behavior (not from yourdown.ps1as written). Using theexternal: truevolume avoids data loss regardless.(light) Sources
- https://abp.io/community/articles/ex7r27y8 (ABP Studio docker container management article; explains Studio’s docker integration approach and scripts)
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) - ABP Studio stops Docker containers by executing
-
0
Hi,
You're right, this is a bug on our side. When you use "Stop" on the whole Containers group ("Stop All"), ABP Studio brings the containers down with
docker compose down -v, and the-vremoves the Compose-managed named volumes too. Stopping an individual container doesn't remove the volumes, which is why the volume survives in that case.For now, mark the volume as
externalso Compose won't remove it even ondown -v:volumes: meinwerk_opensearchdata: external: true name: meinwerk_opensearchdataThen create it once before running:
docker volume create meinwerk_opensearchdataExternal volumes are treated as pre-existing infrastructure, so
down -vleaves them untouched, and your OpenSearch data will persist across "Stop All" from now on. One thing to watch: if your current data is sitting in a project-prefixed volume (e.g.<project>_meinwerk_opensearchdata), pointname:to that exact volume instead of creating a new empty one.We'll fix this in the next ABP Studio release so "Stop All" keeps the volumes just like stopping a single container does.
Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
