decider
decider copied to clipboard
Deployment with docker
💡 Summary
The project is nice, but I think a Docker Image/deployment method is missing.
Motivation and context
The current deployment is inconvenient and is not fitting well in a production environment.
Hello @gso-trifork-security!
Agreed.
Deployment is currently unwieldly and Dockerization is underway internally. Tentatively shooting for next week to have it ready.
What is the error when I try to log in
500 Internal Server Error
You should probably login... logged-out users can only access the login page anyway
Feel free to post error details in the issue thread - I can look at them later (I'll be on later, looking at Docker).
The Admin Guide is the ground truth of install instructions and following the steps from there (versus the readme) might help you out.
Admin Guide Link: https://github.com/cisagov/decider/blob/develop/Decider_Admin_Guide_v1.0.0.pdf
It is also in the root of the repo
Totally agree, the docker deployment would be super beneficial.
Where is the decider.tar.gz anyway. I can see the develop.zip but not the file referenced in the Admin Guide. What am I missing.
@MHMDhub While decider.tar.gz is not present - it is the same as develop.zip or cloning the repo via Git.
Still working on finishing up macOS M1 deployment - but Docker is working just fine on Linux and Windows!
@damionmounts outstanding work! Ill give it a try and provide a feedback
@damionmounts outstanding work! Ill give it a try and provide a feedback
It's good news. When I can try deployment with docker on Linux?
@damionmounts outstanding work! Ill give it a try and provide a feedback
It's good news. When I can try deployment with docker on Linux?
I tried the docker on MacOS Ventura (Intel arch) and I get:
=> => transferring context: 2B 0.0s
=> [decider-db internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> ERROR [decider-web internal] load metadata for docker.io/library/python:3.8-bullseye 0.4s
=> ERROR [decider-db internal] load metadata for docker.io/library/postgres:14-alpine 0.4s
------
> [decider-web internal] load metadata for docker.io/library/python:3.8-bullseye:
------
------
> [decider-db internal] load metadata for docker.io/library/postgres:14-alpine:
------
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: rpc error: code = Unknown desc = error getting credentials - err: exit status 1, out: ```
Hope that helps people knowing more about docker than me.
The docker-compose for the deployment, its already published in the branch.
https://github.com/cisagov/decider/blob/develop/docker-compose.yaml
I tried the docker on MacOS Ventura (Intel arch) and I get:
(...)
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: rpc error: code = Unknown desc = error getting credentials - err: exit status 1, out: ```
Solution was to edit ~/.docker/config.json and rename "credsStore": "desktop"
to "credStore": "desktop"
You might have missed the previous comment from [damionmounts], they are still working on the Mac deployment.
@damionmounts getting this error "2023-03-10 18:03:24.035 UTC [43] FATAL: database "decider" does not exist"
For All: Docker instructions and current testing progress are in the README, but this is the start point:
git clone https://github.com/cisagov/decider.git
cd decider
cp .env.example .env
[sudo] docker compose up
sudo only on Linux
- macOS is still in progress (took a nap earlier but want to sort this before the weekend 🤔)
- @RaulSokolova Have any more of the surrounding log lines?
- I wonder why it isn't creating the DB.
- The database name gets passed to the Postgres container via env (so it seems to be an init issue)
@Cyoux Have any further success after this solution?
Solution was to edit ~/.docker/config.json and rename "credsStore": "desktop" to "credStore": "desktop"
- I was running into the same error output at the start.
- I still need to take a look at the config file to see if mine is wrong as well.
- I may have just chown'd some files to get compose itself working.
- The actual issue is just a Postgres Connection Auth config issue (pg_hba.conf)
- Defaults to scram-sha-256, but the app doesn't support that.
- Will change to md5 perhaps.
- The actual issue is just a Postgres Connection Auth config issue (pg_hba.conf)
@damionmounts it worked fine in Linux, but in WSL is where I'm facing the issue.
@RaulSokolova WSL 1 or 2? I always used a VM so I barely touched WSL before. Docker Desktop on Windows (when you don't have HyperV), will prompt for WSL 2 install and then uses that transparently.
WSL2
🚀 macOS should be a go 🚀 would love to hear any issues people run into
- Auth will now always use md5 - (which is supported without issue versus scram-sha-256).
- 8001 is the new port as mac's ControlCenter was bound to 5000 & 7000.
- Changed Postgres's data local folder mount back to a Docker volume for compatibility.
@Cyoux Have any further success after this solution?
Solution was to edit ~/.docker/config.json and rename "credsStore": "desktop" to "credStore": "desktop" * I was running into the same error output at the start.
I can confirm that - with the current config you pushed - MacOS is a 🚀 GO 🚀
For more details: I have Docker Desktop installed, MacOS Ventura 13.2.1 with Intel core.
Closing as Docker deployment is now supported.
Will of course tend to any newly-created deployment issues. There could always be edge-cases of OS/Arch that don't work