Recommend building the image with docker-compose

If we used the `docker build` to build the image and then
`docker-compose`, we'd build two images.
This commit is contained in:
Javi Martín
2021-11-30 16:47:20 +01:00
parent 0d11301602
commit 7ac5443006
2 changed files with 6 additions and 6 deletions

View File

@@ -80,16 +80,16 @@ cp config/database-docker.yml.example config/database.yml
Then you'll have to build the container with:
```bash
docker build -t consul .
POSTGRES_PASSWORD=password docker-compose build
```
Create your app database images:
Start the database service:
```bash
POSTGRES_PASSWORD=password docker-compose up -d database
```
Once built you can initialize your development DB and populate it with:
You can now initialize your development DB and populate it with:
```
POSTGRES_PASSWORD=password docker-compose run app rake db:create db:migrate

View File

@@ -80,16 +80,16 @@ cp config/database-docker.yml.example config/database.yml
Y generamos el contenedor:
```bash
docker build -t consul .
POSTGRES_PASSWORD=password docker-compose build
```
Creamos las imágenes de base de datos:
Arrancamos el servicio de base de datos:
```bash
POSTGRES_PASSWORD=password docker-compose up -d database
```
Una vez creada la imagen, podemos crear la base de datos e introducir datos de prueba:
Ahora podemos crear la base de datos e introducir datos de prueba:
```
POSTGRES_PASSWORD=password docker-compose run app rake db:create db:migrate