discourse/bin/docker
Gary Pendergast cb5e0d358d
DEV: Run db:create in Docker dev container (#29295)
When attempting to [set up the Docker development environment](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009), I was seeing the following error when running `d/boot_dev --init`:

```
ActiveRecord::NoDatabaseError: We could not find your database: discourse_development. Available database configurations can be found in config/database.yml. (ActiveRecord::NoDatabaseError)
```

Running `db:create` before the `db:migrate` fixed this issue for me. It appears to be safe to run `db:create` even if the database already exists, running `d/rake db:create` locally shows an info message at the database already exists, but doesn't exit with an error.
2024-10-24 12:19:42 +02:00
..
README.md
boot_dev DEV: Run db:create in Docker dev container (#29295) 2024-10-24 12:19:42 +02:00
bundle DEV: Update docker development binstubs 2021-05-21 16:51:10 +01:00
cleanup DEV: Add docker cleanup script to d/ folder 2020-03-01 12:09:07 -08:00
discourse DEV: Update docker development binstubs 2021-05-21 16:51:10 +01:00
ember-cli DEV: Update docker development binstubs 2021-05-21 16:51:10 +01:00
exec DEV: Add env var to bin/docker/exec (#25187) 2024-01-09 12:31:08 -06:00
mailhog DEV: use mailhog in our docker dev environment (#14549) 2021-10-08 11:10:46 +05:30
migrate DEV: Update docker development binstubs 2021-05-21 16:51:10 +01:00
psql DEV: Update docker development binstubs 2021-05-21 16:51:10 +01:00
rails DEV: Update docker development binstubs 2021-05-21 16:51:10 +01:00
rake DEV: Update docker development binstubs 2021-05-21 16:51:10 +01:00
reset_db
rspec DEV: Update docker development binstubs 2021-05-21 16:51:10 +01:00
shell DEV: Update docker development binstubs 2021-05-21 16:51:10 +01:00
shell_root DEV: Update docker development binstubs 2021-05-21 16:51:10 +01:00
shutdown_dev
unicorn DEV: Update docker development binstubs 2021-05-21 16:51:10 +01:00

README.md

Developing using Docker

Since Discourse runs in Docker, why not develop there? If you have Docker installed, you should be able to run Discourse directly from your source directory using a Discourse development container.

You can find installation instructions and related discussion in this meta topic: https://meta.discourse.org/t/beginners-guide-to-install-discourse-for-development-using-docker/102009

Where is the container image/Dockerfile defined?

The Dockerfile comes from discourse/discourse_docker on GitHub, in particular image/discourse_dev.