Add Local development with Docker sections, pending Windows guides
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
* [Communication](forks/communication.md)
|
* [Communication](forks/communication.md)
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
* [Docker](getting_started/docker.md)
|
||||||
* [Prerequisites](getting_started/prerequisites/README.md)
|
* [Prerequisites](getting_started/prerequisites/README.md)
|
||||||
* [Linux](getting_started/prerequisites/linux.md)
|
* [Linux](getting_started/prerequisites/linux.md)
|
||||||
* [macOS](getting_started/prerequisites/macos.md)
|
* [macOS](getting_started/prerequisites/macos.md)
|
||||||
|
|||||||
106
docs/en/getting_started/docker.md
Normal file
106
docs/en/getting_started/docker.md
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
# Using Docker for local development
|
||||||
|
|
||||||
|
You can use Docker to have a local CONSUL installation for development if:
|
||||||
|
- You're having troubles having [prerequisites](prerequisites) installed.
|
||||||
|
- You want to do a quick local installation just to try CONSUL or make a demo.
|
||||||
|
- You prefer not to interfer with other rails installations.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
You should have installed Docker and Docker Compose in your machine:
|
||||||
|
|
||||||
|
### macOS
|
||||||
|
|
||||||
|
You can follow the [official docker install](https://docs.docker.com/docker-for-mac/install/)
|
||||||
|
|
||||||
|
Or if you have [homebrew](http://brew.sh) and [cask](https://caskroom.github.io/) installed you can just:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
brew install docker
|
||||||
|
brew install docker-compose
|
||||||
|
brew cask install docker
|
||||||
|
open -a docker
|
||||||
|
```
|
||||||
|
|
||||||
|
You'll be asked to give Docker app permissions and type your password, then you're set.
|
||||||
|
|
||||||
|
### Linux
|
||||||
|
|
||||||
|
1. Install Docker:
|
||||||
|
```bash
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
|
||||||
|
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main'
|
||||||
|
sudo apt-get update
|
||||||
|
apt-cache policy docker-engine
|
||||||
|
sudo apt-get install -y docker-engine
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Install Docker Compose
|
||||||
|
```bash
|
||||||
|
sudo curl -o /usr/local/bin/docker-compose -L "https://github.com/docker/compose/releases/download/1.15.0/docker-compose-$(uname -s)-$(uname -m)"
|
||||||
|
sudo chmod +x /usr/local/bin/docker-compose
|
||||||
|
```
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
Pending to be completed... Contributions Welcome!
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
### macOS & Linux
|
||||||
|
|
||||||
|
Then lets create our secrets and database config files based on examples:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp config/secrets.yml.example config/secrets.yml
|
||||||
|
cp config/database-docker.yml.example config/database.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
Then you'll have to build the container with:
|
||||||
|
```bash
|
||||||
|
sudo docker build -t consul .
|
||||||
|
```
|
||||||
|
|
||||||
|
Create your app database images:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo docker-compose up -d database
|
||||||
|
```
|
||||||
|
|
||||||
|
Once built you can initialize your development DB and populate it with:
|
||||||
|
```
|
||||||
|
sudo docker-compose run app rake db:create
|
||||||
|
sudo docker-compose run app rake db:migrate
|
||||||
|
sudo docker-compose run app rake db:seed
|
||||||
|
sudo docker-compose run app rake db:dev_seed
|
||||||
|
```
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
Pending to be completed... Contributions Welcome!
|
||||||
|
|
||||||
|
## Running local CONSUL with Docker
|
||||||
|
|
||||||
|
### macOS & Linux
|
||||||
|
|
||||||
|
Now we can finally run the application with:
|
||||||
|
```bash
|
||||||
|
sudo docker-compose up
|
||||||
|
```
|
||||||
|
|
||||||
|
And you'll be able to acces it at your browser visiting [http://localhost:3000](http://localhost:3000)
|
||||||
|
|
||||||
|
Additionally, if you want to run the rails console just run in another terminal:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo docker-compose run app rails console
|
||||||
|
```
|
||||||
|
|
||||||
|
To verify the containers are up execute **sudo docker ps .** You should see output similar to this:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
Pending to be completed... Contributions Welcome!
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
* [Comunicación](forks/communication.md)
|
* [Comunicación](forks/communication.md)
|
||||||
|
|
||||||
### Instalación
|
### Instalación
|
||||||
|
* [Docker](getting_started/docker.md)
|
||||||
* [Prerrequisitos](getting_started/prerequisites/README.md)
|
* [Prerrequisitos](getting_started/prerequisites/README.md)
|
||||||
* [Linux](getting_started/prerequisites/linux.md)
|
* [Linux](getting_started/prerequisites/linux.md)
|
||||||
* [macOS](getting_started/prerequisites/macos.md)
|
* [macOS](getting_started/prerequisites/macos.md)
|
||||||
|
|||||||
106
docs/es/getting_started/docker.md
Normal file
106
docs/es/getting_started/docker.md
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
# Usando Docker para desarrollo en local
|
||||||
|
|
||||||
|
Puedes usar Docker para tener una instalación local de CONSUL si:
|
||||||
|
- Estás teniendo problemas para instalar los [prerrequisitos](prerequisites) correctamente.
|
||||||
|
- Quieres tener una instalación local rápidamente para probar o hacer una demo.
|
||||||
|
- Prefieres no interferir con instalaciones de apps Rails existentes.
|
||||||
|
|
||||||
|
## Prerrequisitos
|
||||||
|
|
||||||
|
Debes tener instalador Docker y Docker Compose en tu ordenador:
|
||||||
|
|
||||||
|
### macOS
|
||||||
|
|
||||||
|
Puedes seguir la [guía oficial de docker](https://docs.docker.com/docker-for-mac/install/)
|
||||||
|
|
||||||
|
O si tienes instalado [homebrew](http://brew.sh) y [cask](https://caskroom.github.io/) puedes ejecutar:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
brew install docker
|
||||||
|
brew install docker-compose
|
||||||
|
brew cask install docker
|
||||||
|
open -a docker
|
||||||
|
```
|
||||||
|
|
||||||
|
La aplicación de Docker te pedirá darle permisos e intrudocir tu contraseña.
|
||||||
|
|
||||||
|
### Linux
|
||||||
|
|
||||||
|
1. Instala Docker:
|
||||||
|
```bash
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
|
||||||
|
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main'
|
||||||
|
sudo apt-get update
|
||||||
|
apt-cache policy docker-engine
|
||||||
|
sudo apt-get install -y docker-engine
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Instala Docker Compose
|
||||||
|
```bash
|
||||||
|
sudo curl -o /usr/local/bin/docker-compose -L "https://github.com/docker/compose/releases/download/1.15.0/docker-compose-$(uname -s)-$(uname -m)"
|
||||||
|
sudo chmod +x /usr/local/bin/docker-compose
|
||||||
|
```
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
Pendiente de ser completado... ¡Se agradecen las Contribuciones!
|
||||||
|
|
||||||
|
## Instalación
|
||||||
|
|
||||||
|
### macOS & Linux
|
||||||
|
Creamos nuestros ficheros de secrets y database basados en los ejemplos:
|
||||||
|
```bash
|
||||||
|
cp config/secrets.yml.example config/secrets.yml
|
||||||
|
cp config/database-docker.yml.example config/database.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
Y generamos el contenedor:
|
||||||
|
```bash
|
||||||
|
sudo docker build -t consul .
|
||||||
|
```
|
||||||
|
|
||||||
|
Creamos las imágenes de base de datos:
|
||||||
|
```bash
|
||||||
|
sudo docker-compose up -d database
|
||||||
|
```
|
||||||
|
|
||||||
|
Y la inicializamos con:
|
||||||
|
```
|
||||||
|
sudo docker-compose run app rake db:create
|
||||||
|
sudo docker-compose run app rake db:migrate
|
||||||
|
sudo docker-compose run app rake db:seed
|
||||||
|
sudo docker-compose run app rake db:dev_seed
|
||||||
|
```
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
Pendiente de ser completado... ¡Se agradecen las Contribuciones!
|
||||||
|
|
||||||
|
## Corriendo CONSUL en local con Docker
|
||||||
|
|
||||||
|
### macOS & Linux
|
||||||
|
|
||||||
|
Una vez instalado, puedes lanzar la aplicación con:
|
||||||
|
```bash
|
||||||
|
sudo docker-compose up
|
||||||
|
```
|
||||||
|
|
||||||
|
Y podrás acceder a la aplicación desde tu navegador visitando [http://localhost:3000](http://localhost:3000)
|
||||||
|
|
||||||
|
Adicionalmente, si quieres lanzar por ejemplo la consola de rails:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo docker-compose run app rails console
|
||||||
|
```
|
||||||
|
|
||||||
|
Para verificar que los contenedores estan corriendo usa:
|
||||||
|
`sudo docker ps .`
|
||||||
|
|
||||||
|
Deberías obtener algo similar a:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
Pendiente de ser completado... ¡Se agradecen las Contribuciones!
|
||||||
Reference in New Issue
Block a user