Prior to this commit, the db container would create a database named “ofn” (the same as $POSTGRES_USER). Then, when the web container started, it would run `rake db:reset`. This would load the Rails environment, which ends up requiring some model files, which eventually end up trying to connect to the “open_food_network_dev” database, which doesn’t exist. Therefore setting up the database fails, and it’s impossible to boot the web container. As a side note, I’m not convinced that bootstrapping the database as part of the container’s command is the best strategy (if for no other reason that this will wipe my database every time I run `docker-compose up`). But this commit doesn’t change that. What it does is add the $POSTGRES_DB environment variable so that the db container creates the “open_food_network_dev” database (which is blank). Then, when `rake db:reset` runs, it’ll successfully connect to this (empty) database while loading the environment, before deleting and recreating it. Note that I had to manually delete the `openfoodnetwork_postgres` volume in order to reset my local state, after making this change.
Open Food Network
The Open Food Network is an online marketplace for local food. It enables a network of independent online food stores that connect farmers and food hubs (including coops, online farmers' markets, independent food businesses etc); with individuals and local businesses. It gives farmers and food hubs an easier and fairer way to distribute their food.
Supported by the Open Food Foundation and a network of global affiliates, we are proudly open source and not-for-profit - we're trying to seriously disrupt the concentration of power in global agri-food systems, and we need as many smart people working together on this as possible.
We're part of global movement - get involved!
- Join the conversation on Slack. Make sure you introduce yourself in the #general channel
- Head to https://openfoodnetwork.org for more information about the global OFN project.
- Check out the User Guide for a list of features and tutorials.
- Join our discussion forum.
Contributing
If you are interested in contributing to the OFN in any capacity, please introducing yourself on Slack, and have a look through our Contributor Guide
Our GETTING_STARTED and CONTRIBUTING guides are the best place to start for developers looking to set up a development environment and make contributions to the codebase.
Provisioning
If you're interested in provisioning a server, see ofn-install for the project's Ansible playbooks.
We also have a Super Admin Guide to help with configuration of new servers.
Testing
We use BrowserStack as a manual testing tool. BrowserStack provides open source projects with unlimited and free of charge accounts. A big thanks to them!
Licence
Copyright (c) 2012 - 2019 Open Food Foundation, released under the AGPL licence.
