meow icon indicating copy to clipboard operation
meow copied to clipboard

Remove need for an init script

Open DumboOctopus opened this issue 4 years ago • 0 comments

The init_script shouldn't be necessary. Here are the steps to removing it.

1. Remove the MeowSetting model

MeowSetting are using for adding API keys and configuring general settings. This should be replaced with django settings variables. These settings variables are declared in meow/meow/settings.py. The values for these setting variables should be retrieved from environment variables.

Then, whenever we need to use it, we just from settings import MEOW_VARAIBLE.

2. Creating the Test section and the Periodic Task

This will be tricky. We don't want any of our code for setting up these sections to run on production. Thus, we can't put this inside of the Dockerfile or the docker-compose or the entrypoint. I'm not sure how to do this yet. The best idea I have so far is putting an if statement in the entrypoint

if DEBUG = "true" then
   # create the test section if it doesn't exist
   # create the periodic task if it doesn't exist
fi

the issue with this is that it runs every time you start the container. This should only run the first time you start the container.

DumboOctopus avatar Apr 10 '20 06:04 DumboOctopus