* Improve format and clarity of the docs [ci skip] While this change produces a lot of git noise by enacting what seems like an arbitrary linewrap on most of the files in the documentation it will result in better version control and tracking of the changes in the documentation. For example, as it currently stands, if one was to make a PR to move a comma in a sentence because each paragraph in most of the files is on a single line, that small change would look in the git history like the author had modified the entire paragraph. In reality, this author just moved a comma. This change also includes a significant number of modifications to the more article-esque docs. Many of these docs were written in a sort of stream-of-conciousness and aren't as easy to read as they could be. Hopefully this is the first of several readability changes. If we could get these docs to a more accessible reading level, we would probably see an increase in contributions. :) * Delegate markdown wrapping to Prettier * Add linewrapping explanation in the docs [ci skip]
75 lines
2.7 KiB
Markdown
75 lines
2.7 KiB
Markdown
---
|
|
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)!
|
|
|
|
## Installing prerequisites
|
|
|
|
_These prerequisites assume you're working on an operating system supported by
|
|
Docker._
|
|
|
|
### Docker and Docker Compose
|
|
|
|
Docker is available for many different operating systems. We recommend you
|
|
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.
|
|
|
|
## 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. Set up your environment variables/secrets
|
|
|
|
- Take a look at `Envfile`. This file lists all the `ENV` variables we use
|
|
and provides a fake default for any missing keys. You'll need to get your
|
|
own free [Algolia credentials](/backend/algolia) to get your development
|
|
environment running.
|
|
- The [backend guide](/backend) will show you how to get free API keys for
|
|
additional services that may be required to run certain parts of the app.
|
|
- 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.
|
|
1. Obtain the development variable and apply the key you wish to
|
|
enter/replace. i.e.:
|
|
|
|
```shell
|
|
GITHUB_KEY: "SOME_REAL_SECURE_KEY_HERE"
|
|
GITHUB_SECRET: "ANOTHER_REAL_SECURE_KEY_HERE"
|
|
```
|
|
|
|
- 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.
|
|
|
|
## Running the Docker app (basic)
|
|
|
|
_Docker compose will by default use postgres:9.6 as the database version, should
|
|
you want to update that set the `POSTGRES_VERSION` variable in your environment
|
|
and start the container again_
|
|
|
|
1. run `docker-compose build`
|
|
1. run `docker-compose run web rails db:setup`
|
|
1. run `docker-compose run web yarn install`
|
|
1. run `docker-compose up`
|
|
1. That's it! Navigate to <http://localhost:3000>
|
|
|
|
## Running the Docker app (advanced)
|
|
|
|
DEV provides a `docker-run.sh` script which can be used to run the Docker app
|
|
with custom options.
|
|
|
|
Please execute the script itself to view all additional options:
|
|
|
|
```shell
|
|
./docker-run.sh
|
|
```
|