Hi, I have a question about building prodigy and connecting it to postgresql on docker.
My scripts are as follows, but whenever I tried to "docker-compose up," I got the following error. Could you let me know why "serve" does not work or any errors that I might have missed? Many thanks!
Thanks for your question and welcome to the Prodigy community
Like the error message is saying, this is because there isn't a built-in Prodigy recipe named serve.
Can you explain why you included?
prodigy serve /prodigy/data/prodigy.json
It's not needed either. By default, running any of the prodigy recipes it'll look for your Prodigy config file. Perhaps if you remove this statement it'll work.
Also, be sure to read through our docs on deployment. It seems like you're not using a .env file to pass your license key, which is a good practice. You may find several other ideas in those docs to help you.
Yes, it seems there is no such command, but I do not know how to incorporate a customized configuration (prodigy.json: db information, model use information - not use spacy models) in building prodigy on Docker. Could you let me know how to apply the customized configuration?
Dockerfile for prodigy
I read through the docks on deployment. I am not using a .env file because I would like to keep in simple; instead, I set to install prodigy with my serial key as I did on my local machine. A .env file is necessary? Couldn't I do this way?
So you only need to have your prodigy.json in the folder you're running your command from. For example, in the Prodigy Deployment docs, it mentions this in the COPY . . statement:
The COPY . . line will copy all the files from your project folder into the Docker container. This typically includes any custom recipes you’ve written as well as the prodigy.json configuration file. However, files described in your .dockerignore will be skipped. This ignore file allows you to configure which files should never get copied in, in an attempt to keep the container lightweight. We recommend adding any virtualenv environment folders as well as datasets that should not be annotated. Also note that a general COPY . . command should always be done after steps that involve installation to make sure that the Docker caching mechanism prevents extra work.
The COPY . . will copy all of the files from your project folder so alternatively you could select only the prodigy.json to be copied (COPY prodigy.json .).
The problem is: where are you storing the prodigy.json and/or Dockerfile with your license key? For most times, we'd expect you'd be storing that on a git repository. And the goal would be to not include those credentials directly on such a repo. That's why we recommend using .env file to avoid passing sensitive information in your prodigy.json file like your secure database credentials:
While it can be a good idea to store the prodigy.json file in your git repository, you don’t want to add the database credentials to it. The password is purposefully kept out of the prodigy.json file in this example and will instead be filled in by a script that reads from a environment variable.
The host and user are also good candidates for environment variables, but we’ve kept these variables in the example to make it easier to explain the required parameters.
As you may have seen, we provide an example Python script on how to update your prodigy.json file during the Dockerfile setup. This avoids you needing to load your prodigy.json file in your git repository.