
Trying to run Homebrewery locally via Docker/MongoDB on Linux Mint unsuccessfully, need help!
Hi, hopefully I'm not in the wrong place here, but I thought I'd ask since I'm a complete noob when it comes to linux, self-hosting and that stuff in general, but I'm eager to learn, which is why I'm here.
I've been figuring out Linux Mint for the past few months to finally leave windows behind me, and have been lately trying to figure out hosting webtools locally, but I feel like I'm not really understanding somethings
After trying to follow this guide on github, I've gotten the required programs/tools like MongoDB, Compass, Docker, etc. installed and running AFAIK, though I feel like I'm just following steps without really understanding what I'm doing, at least not fully.
I've also kinda hit a wall because the github is assuming I'm using ubuntu or windows, so that's also kind of confusing sometimes.
On to my issues:
> 4. Go to the C:\ drive and create a folder called "data".
> 5. Inside the "data" folder, create a new folder called "db".
> 6. Open a command prompt or other terminal and navigate to your MongoDB install folder (C:\Program Files\Mongo\Server\6.0\bin).
These already don't really translate well if I'm understanding correctly. Essentially put those two folders in "Z:/home/myusername/data/db", but I don't really understand what is meant by navigating to the MongoDB install folder, do they mean typing "cd /usr/bin/mongodb" in the terminal (and is that even the install folder?)
> 7. In the command prompt, run "mongod", which will start up your local database server.
That works.
> 8. While MongoD is running, open a second command prompt and navigate to the MongoDB install folder.
I'm again confused what is meant by navigating explicitly, and also where this folder even is supposed to be.
> 9. Search in Windows for "Advanced system settings" and open it.
> 10. Click "Environment variables", find the "path" variable, and double-click to open it.
> 11. Click "New" and paste in the path to the MongoDB "bin" folder.
> 12. Click "OK" three times to close all the windows.
> 13. In the second command prompt, run "mongo", which allows you to edit the database.
> 14. Type use homebrewery to create The Homebrewery database. You should see switched to db homebrewery.
> 15. Type db.brews.insertOne({"title":"test"}) to create a blank document. You should see { acknowledged: true, insertedId: ObjectId("63c2fce9e5ac5a94fe2410cf") }
Now I'm just confused because of my own ignorance towards linux, but I've not been able to figure out how to understand how this translates into Linux Mint's OS, or if this is even necessary since I'm not using Windows.
After realising I'm not really getting ahead
I saw a guide for running it using docker, so I tried to do that. Also didn't really work.
I've been able to clone the github docker image (puts it in Z:/home/homebrewery), but then I started having issues again.
For one, it asks me to edit a file called "config/docker.json" (if I want to?) or otherwise run the following script:
{
"host" : "localhost:8000",
"naturalcrit_url" : "local.naturalcrit.com:8010",
"secret" : "secret",
"web_port" : 8000,
"mongodb_uri": "mongodb://172.17.0.2/homebrewery",
}
docker-compose build homebrewery
And again didn't really work. The first script ran, but "docker-compose" as a command didn't work at all, tried it without "-compose" and then it kinda ran?
docker run --name homebrewery-mongodb -d --restart unless-stopped -v mongodata:/data/db -p 27017:27017 mongo:latest
# Make sure you run this in the homebrewery directory
docker run --name homebrewery-app -d --restart unless-stopped -e NODE_ENV=docker -v $(pwd)/config/docker.json:/usr/src/app/config/docker.json -p 8000:8000 docker.io/library/homebrewery:latest
After trying the above scripts, I just get an error message telling me that either the homebrewery database doesn't exist or that I can't access it, and that's essentially where I'm stuck at.
I have in fact added my own username to Docker's access group like required, so I'm pretty sure that's not the problem. As I believe is obvious, I have no idea what I'm doing anymore, so I thought I'd ask here. Any ideas what I'm missing?