Require most recent version of Docker.
Domains for local development¶
You will need two domain to run this app. One for the public site and one for the apply site.
Add this to your
The "test" TLD is safe to use, it's reserved for testing purposes.
All examples from now on will use the
Get the code¶
Create media directory¶
In production media is stored on AWS S3 but for local development you need a "media" directory.
Build the Docker images¶
Run the docker compose command to build the images. This will take some time.
If you need to rebuild the images to get a later version just run the "build" again.
The build command needs to be run from Hypha root so it can copy needed files. The other commands are easier to run directly from the "docker" sub directory.
Start the docker environment¶
Move to the "docker" directory.
To start the docker containers you use the "up" command. This command you will use each time you want to start up and use this docker environment.
Access the docker environment¶
Go to http://hypha.test:8090/
Run commands in the docker environment¶
To get bash shell on the container that runs the Django app, use this command.
Here you can issue django commands as normal. You might want to change the user - the default is circleci, but most of the code is owned by the user 'node'. To do that:
To get a shell on the container that runs Postgres, use this command.
Stop the docker environment.¶
ctrl+c in the terminal window.
Restore a database dump in Docker¶
We will use the "public/sandbox_db.dump" for this example. That is a good start in any case, you get some example content etc.
First get a shell on the db container.
Then in that shell you need to install
wget to download the db dump.
Then download the sandbox db dump from Github.
Before being able to work on this database, you have to drop and prevent any other connections to it.
With this done, drop and then create the hypha database and run the pg restore command like this.
After restoring the sandbox db run the migrate command inside the py container.