You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ The main goal of this project is to have a single Docker image to develop all yo
4
4
5
5
The Docker container also provides developer-friendly tools and behaviours like persisted **Ruby console history** (IRB and Pry), **shell history**, or even auto-installing dependencies (that's right: simply change your `Gemfile` or `package.json` and **`bundle install` or `yarn install` will be run automatically** for you and only when necessary). It also provides a few CLI tools to get your hands dirty, but as least as possible: `vim`, `nano`, `heroku`.
6
6
7
-
The default command (when you just `docker-compose up`) is to run `foreman start`, thus starting whatever you put in your `Procfile` (except the `release` process, if you have one: it's a reserved process name by Heroku/Dokku). All commands are run inside the container **as the same user that owns your codebase** (thus probably your host user), which means that any file generated inside the container (think of `rails generate`, `yarn init`, or even log files) will be owned by yourself (not by `root`, like they would with a default Docker configuration).
7
+
The default command (when you just `dockercompose up`) is to run `foreman start`, thus starting whatever you put in your `Procfile` (except the `release` process, if you have one: it's a reserved process name by Heroku/Dokku). All commands are run inside the container **as the same user that owns your codebase** (thus probably your host user), which means that any file generated inside the container (think of `rails generate`, `yarn init`, or even log files) will be owned by yourself (not by `root`, like they would with a default Docker configuration).
8
8
9
9
We try to use sane default conventions so you don't have to think about it, but this image also allows some configuration (_e.g._ Heroku CLI or Git authentication) and [customisation](#customisation) (install extra software inside the container). See the [recipes book](RECIPES.md) for more details.
10
10
@@ -50,21 +50,21 @@ services:
50
50
You can now start your project with:
51
51
52
52
```shell
53
-
docker-compose up
53
+
dockercompose up
54
54
```
55
55
56
56
Or run any command (like `rake`, `bash`, or whatever else) with:
57
57
58
58
```shell
59
-
docker-compose run app [rake|bash|...]
59
+
dockercompose run app [rake|bash|...]
60
60
```
61
61
62
62
> 💡 Note that you don't need to prefix commands with `bundle exec`.
63
63
64
64
You can even bypass dependencies check/auto-install before the command is run by setting the `DISABLE_AUTO_INSTALL_DEPS` environment variable from the command-line:
65
65
66
66
```shell
67
-
docker-compose run -e DISABLE_AUTO_INSTALL_DEPS=1 app bash
67
+
dockercompose run -e DISABLE_AUTO_INSTALL_DEPS=1 app bash
68
68
```
69
69
70
70
## Customisation
@@ -101,7 +101,7 @@ You can customise this image by **building your own image based on this one** (o
101
101
> 1. Run a shell as root in the container (notice the empty entrypoint):
102
102
>
103
103
> ```shell
104
-
> docker-compose run --entrypoint= app bash
104
+
> dockercompose run --entrypoint= app bash
105
105
> ```
106
106
>
107
107
> 2. Install the pakckage using APT (any change will be undone when you close the shell):
Copy file name to clipboardExpand all lines: RECIPES.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ Please refer to [README.md](README.md) for generic overview, setup and usage ins
47
47
3. Install Rails and generate your Rails application (it replaces the usual `gem install rails && rails new my_project`command that you will find in every documentation and tutorial out there):
48
48
49
49
```shell
50
-
docker-compose run app bash -c "bundle init && bundle add rails && rails new . --force --skip-spring"
50
+
dockercompose run app bash -c "bundle init && bundle add rails && rails new . --force --skip-spring"
51
51
```
52
52
53
53
> 💡 You can specify the Rails version you want by appending the [`--version` switch](https://bundler.io/v1.16/man/bundle-add.1.html#OPTIONS) to the `bundle add rails`command (_e.g._ `--version "~> 5.2.0"`).
@@ -64,7 +64,7 @@ Please refer to [README.md](README.md) for generic overview, setup and usage ins
64
64
65
65
> ⚠️ Whatever you do in this `Procfile`, always configure your servers to listen on `0.0.0.0` (`puma` [does it](https://github.com/puma/puma/blob/8dbc6eb6ed96b2cefa7092dd398ea2c0a4a0be80/lib/puma/configuration.rb#L10) by default but using `rails server` [forces it](https://github.com/rails/rails/blob/b10f371366a606310cab26648d798836e030bdc8/railties/lib/rails/commands/server/server_command.rb#L236) to listen to `localhost`, unless you override it again using the `-b|--binding` switch like above). Without it, you won't be able to connect to this server from outside the running container.
66
66
67
-
5. Run `docker-compose up app` as usual and you're [good to profit 🎉](http://localhost:5000).
67
+
5. Run `dockercompose up app` as usual and you're [good to profit 🎉](http://localhost:5000).
68
68
69
69
### Creating a gem from scratch
70
70
@@ -93,7 +93,7 @@ Please refer to [README.md](README.md) for generic overview, setup and usage ins
93
93
3. Generate your gem skeleton (it just needs to trick `bundler` to think that the current directory is available as a subdirectory named `my_project`):
You can now start PGAdmin using the usual command `docker-compose up pgadmin` then access it on http://localhost:5050 🐘 (from where you can configure it to connect to the PostgreSQL server on host `postgres` with user `postgres` and no password).
274
+
You can now start PGAdmin using the usual command `dockercompose up pgadmin` then access it on http://localhost:5050 🐘 (from where you can configure it to connect to the PostgreSQL server on host `postgres` with user `postgres` and no password).
275
275
276
276
### Using MailCatcher
277
277
@@ -329,7 +329,7 @@ Your application will now send all emails to MailCatcher SMTP server and you can
329
329
330
330
## Configuration
331
331
332
-
Most configurations can be done from a `docker-compose.override.yml` file alongside your `docker-compose.yml` file (by default, it will be [automatically read](https://docs.docker.com/compose/extends/#multiple-compose-files) by `docker-compose`, and it should probably be [gitignore'd globally](https://help.github.com/articles/ignoring-files/#create-a-global-gitignore)).
332
+
Most configurations can be done from a `docker-compose.override.yml` file alongside your `docker-compose.yml` file (by default, it will be [automatically read](https://docs.docker.com/compose/extends/#multiple-compose-files) by `dockercompose`, and it should probably be [gitignore'd globally](https://help.github.com/articles/ignoring-files/#create-a-global-gitignore)).
333
333
334
334
### Heroku CLI authentication
335
335
@@ -447,24 +447,24 @@ services:
447
447
First of all, make sure your development database exists and is empty:
To copy a database dump (_e.g._ `latest.dump`) to your local Postgres development database, use [`pg_restore`](https://www.postgresql.org/docs/current/app-pgrestore.html):
To copy a Postgres database from Heroku to your local development environment (assuming you followed the Postgres config from the [using PostgreSQL](#using-postgresql) section), use [`heroku pg:pull`](https://devcenter.heroku.com/articles/heroku-cli-commands#heroku-pg-pull-source-target):
465
465
466
466
```shell
467
-
docker-compose run -e PGSSLMODE=prefer -e DISABLE_AUTO_INSTALL_DEPS=1 app heroku pg:pull DATABASE_URL postgres://postgres:password@postgres/app_development -a your-heroku-app
467
+
dockercompose run -e PGSSLMODE=prefer -e DISABLE_AUTO_INSTALL_DEPS=1 app heroku pg:pull DATABASE_URL postgres://postgres:password@postgres/app_development -a your-heroku-app
468
468
```
469
469
470
470
> ℹ️ You need [Heroku CLI authentication](#heroku-cli-authentication) configured for this to work.
0 commit comments