Trying Keygen for the first time (Docker compose structure) #126
-
Hello, in my company we are looking for a licensing tool for our app. I wanted to try Keygen CE locally to test it's capabilities. I created this docker compose following the documentation:
Im using my machine IP because it doesn't work with localhost. I have this error that I don't know how to resolve because I cannot launch keygen container, it crashes on launch.
/usr/local/bundle/ruby/3.2.0/gems/activerecord-7.0.7.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:19:in `exec': PG::UndefinedTable: ERROR: relation "accounts" does not exist (ActiveRecord::StatementInvalid) LINE 9: WHERE a.attrelid = '"accounts"'::regclass With dbeaver I checked 'SELECT * FROM pg_attribute' and 'a.attrelid = '"accounts"' doesn't exist. The table has 3100~ rows but no that one. Can anyone help me? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
The error is saying the Please keep in mind that Keygen needs its own database; it cannot be shared with another application. |
Beta Was this translation helpful? Give feedback.
-
I updated the docker compose file:
Then I created this launch_keygen.sh file which will fill the DB that was empty and was the origin of the problem:
I was trying to avoid host.docker.internal because in production we have linux environments. I tried using it with windows docker desktop and it worked. The DB is filled: Finally, I did a 'docker compose down' of the 2 containers (redis and postgres) but if you notice, I am saving the data from the containers on the host volumes in the parameter 'volumes' of both redis and postgres. Then I add the third keygen container and I do docker compose up again, but now with 3 containers and with the db filled.
The result: |
Beta Was this translation helpful? Give feedback.
-
In the keygen container I see this, the server and worker looks like they are already running and I don't have to execute the server and worker commands. Am I right? (I tried the server run command and the log was identical to the keygen container log). However, how do I manage the keygen service? I don't want to 'docker run' again with all the variables in it because I already have the container with keygen running.
|
Beta Was this translation helpful? Give feedback.
-
Rails commands are working: I added the URL to the hosts with:
However, I can't connect to the keygen endpoints:
|
Beta Was this translation helpful? Give feedback.
-
We have an official Compose file now: https://github.com/keygen-sh/keygen-api/blob/master/docker-compose.yaml lmk your thoughts and feedback. |
Beta Was this translation helpful? Give feedback.
We have an official Compose file now: https://github.com/keygen-sh/keygen-api/blob/master/docker-compose.yaml
lmk your thoughts and feedback.