Add redis container to docker-compose (#4965)
* Add redis container to docker-compose [fix issue 4962] * Updates docker.md
This commit is contained in:
parent
bff6cd6985
commit
0039e67467
2 changed files with 23 additions and 7 deletions
|
|
@ -6,6 +6,7 @@ services:
|
|||
- "3000:3000"
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
environment:
|
||||
RAILS_ENV: development
|
||||
DATABASE_URL: postgres://postgres:mysecretpassword@db:5432/postgres
|
||||
|
|
@ -28,3 +29,7 @@ services:
|
|||
image: postgres:${POSTGRES_VERSION:-9.6.15-alpine}
|
||||
ports:
|
||||
- "5432:5432"
|
||||
redis:
|
||||
image: "redis"
|
||||
ports:
|
||||
- "6379:6379"
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ title: Docker
|
|||
# Installing DEV with Docker [Beta]
|
||||
|
||||
Our docker implementation is incomplete and may not work smoothly. Please,
|
||||
kindly [report any
|
||||
issues](https://github.com/thepracticaldev/dev.to/issues/new/choose)!
|
||||
kindly
|
||||
[report any issues](https://github.com/thepracticaldev/dev.to/issues/new/choose)!
|
||||
|
||||
## Installing prerequisites
|
||||
|
||||
|
|
@ -20,13 +20,15 @@ follow the [Docker CE install guide](https://docs.docker.com/install/), which
|
|||
illustrates multiple installation options for each OS.
|
||||
|
||||
You're also going to need Docker Compose, to start multiple containers. We
|
||||
recommend you follow the [Docker Compose install
|
||||
guide](https://docs.docker.com/compose/install/) as well.
|
||||
recommend you follow the
|
||||
[Docker Compose install guide](https://docs.docker.com/compose/install/) as
|
||||
well.
|
||||
|
||||
## Installing DEV
|
||||
|
||||
1. Fork DEV's repository, e.g. <https://github.com/thepracticaldev/dev.to/fork>
|
||||
1. Clone your forked repository, eg. `git clone https://github.com/<your-username>/dev.to.git`
|
||||
1. Clone your forked repository, eg.
|
||||
`git clone https://github.com/<your-username>/dev.to.git`
|
||||
1. Set up your environment variables/secrets
|
||||
|
||||
- Take a look at `Envfile`. This file lists all the `ENV` variables we use
|
||||
|
|
@ -38,8 +40,9 @@ guide](https://docs.docker.com/compose/install/) as well.
|
|||
- For any key that you wish to enter/replace:
|
||||
|
||||
1. Create `config/application.yml` by copying from the provided template
|
||||
(i.e. with bash: `cp config/sample_application.yml config/application.yml`). This is a personal file that is ignored in
|
||||
git.
|
||||
(i.e. with bash:
|
||||
`cp config/sample_application.yml config/application.yml`). This is a
|
||||
personal file that is ignored in git.
|
||||
1. Obtain the development variable and apply the key you wish to
|
||||
enter/replace. i.e.:
|
||||
|
||||
|
|
@ -48,6 +51,14 @@ guide](https://docs.docker.com/compose/install/) as well.
|
|||
GITHUB_SECRET: "ANOTHER_REAL_SECURE_KEY_HERE"
|
||||
```
|
||||
|
||||
- Update the redis url variables by adding the following lines into
|
||||
`config/application.yml`:
|
||||
|
||||
```shell
|
||||
REDIS_URL: "redis://redis:6379"
|
||||
REDIS_SESSIONS_URL: "redis://redis:6379"
|
||||
```
|
||||
|
||||
- You do not need "real" keys for basic development. Some features require
|
||||
certain keys, so you may be able to add them as you go.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue