Skip to content

Commit

Permalink
Fixed bug in Docker when MongoDB data resets after container starts.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexInCube committed Aug 25, 2024
1 parent 706f49a commit d5f8d88
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@ Cool audiobot for Discord created by <a href="https://vk.com/alexincube"><b>@Ale
- Localization (English and Russian are currently supported)
- Command /alcotest which shows your alcohol count in blood
- Go to [Wiki](https://github.com/AlexInCube/AlCoTest/wiki) to get more information about features, commands, and others.

## 🐛 Bugs or problems

If you have issues, try to update your `docker-compose.yml`, `updateAndRunInDocker.sh` files.
And run `sh updateAndRunInDocker.sh`.
If bugs are persisted on the latest version of bot,
please create [issue](https://github.com/AlexInCube/AlCoTest/issues/new/choose).
6 changes: 5 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
- path: ./.env.development
required: false
volumes:
- ./data:/data/db
- "aicbot-mongo-volume:/data/db"
ports:
- '27017:27017'
aicbot:
Expand Down Expand Up @@ -38,3 +38,7 @@ services:
- aicbot-mongo
depends_on:
- aicbot-mongo

volumes:
aicbot-mongo-volume:
external: true
4 changes: 3 additions & 1 deletion updateAndRunInDocker.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/sh
docker image pull alexincube/aicotest:latest
docker compose up --detach --force-recreate --no-build --remove-orphans
docker volume create --name=aicbot-mongo-volume
docker compose stop
docker compose up --detach --no-build --remove-orphans

0 comments on commit d5f8d88

Please sign in to comment.