Skip to content

Commit 06e3ef2

Browse files
committed
use exec command in container documentation
The `docker compose exec` advantage is that it runs the command inside the already running container and avoid to create new containers.
1 parent 1abb21f commit 06e3ef2

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

Docker.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ LinuxFr on Docker
22
-----------------
33

44
To simplify set up of a developement environment, LinuxFr.org can be
5-
run on Docker with `docker-compose up`.
5+
run on Docker with `docker compose up`.
66

77
To init the SQL database schema, you need to wait upto the `database`
88
container to be ready to listen MySQL connections.
@@ -18,7 +18,7 @@ Or you can check the `database` container status to be "healthy".
1818
Then, open a second terminal and run:
1919

2020
```
21-
docker-compose exec linuxfr.org bin/rails db:setup
21+
docker compose exec linuxfr.org bin/rails db:setup
2222
```
2323

2424
Finally, the environment is ready and you can open [http://dlfp.lo](http://dlfp.lo)
@@ -45,7 +45,7 @@ service.
4545

4646
If you want to change the application port and/or other configurations, you can
4747
[override](https://docs.docker.com/compose/extends/)
48-
the docker-compose configuration (in particular the `nginx` service for
48+
the docker compose configuration (in particular the `nginx` service for
4949
the port).
5050

5151
Notice, that if LinuxFr.org doesn't run on port 80, the image cache
@@ -54,7 +54,7 @@ service won't work well and so you won't be able to see images in the news.
5454
Test modifications
5555
==================
5656

57-
The docker-compose is currently configured to share `./app`, `./db` and
57+
The docker compose is currently configured to share `./app`, `./db` and
5858
`./public` directories with the docker container.
5959

6060
So you can update files with your prefered IDE on your machine. Rails
@@ -64,7 +64,7 @@ Furthermore, if you need to access the Rails console, you need a second
6464
terminal and run:
6565

6666
```
67-
docker-compose run linuxfr.org bin/rails console
67+
docker compose exec linuxfr.org bin/rails console
6868
```
6969

7070
Note: currently, we didn't configure rails to show directly the
@@ -84,7 +84,7 @@ To get help about writing tests, see the
8484
To run tests with Docker environment, you need to use this command:
8585

8686
```
87-
docker-compose run linuxfr.org bin/rails test -v
87+
docker compose exec linuxfr.org bin/rails test -v
8888
```
8989

9090
Inspect the database schema
@@ -104,20 +104,20 @@ In case you need to apply new database migrations, you need a second
104104
terminal and run:
105105

106106
```
107-
docker-compose run linuxfr.org bin/rails db:migrate
107+
docker compose exec linuxfr.org bin/rails db:migrate
108108
```
109109

110110
If you had issue and want to reset all data in your database system,
111111
use:
112112

113113
```
114-
docker-compose run linuxfr.org bin/rails db:reset
114+
docker compose exec linuxfr.org bin/rails db:reset
115115
```
116116

117-
Services provided by the docker-compose
117+
Services provided by the docker compose
118118
=======================================
119119

120-
Currently, these services are directly enabled by docker-compose:
120+
Currently, these services are directly enabled by docker compose:
121121

122122
1. The [LinuxFr.org](https://github.com/linuxfrorg/linuxfr.org)
123123
ruby on rails application itself
@@ -134,7 +134,7 @@ For now, these services aren't available:
134134
because it requires to run
135135
LinuxFr.org with a TLS certificate. When the service will accept to
136136
fetch articles with simple `http://`, we'll be able to provide it
137-
directly with docker-compose.
137+
directly with docker compose.
138138
2. The [svgtex service](https://github.com/linuxfrorg/svgtex), because LinuxFr
139139
has hard-coded the `localhost`
140140
hostname in it's [HTML Pipeline tool](https://github.com/linuxfrorg/html-pipeline-linuxfr/blob/linuxfr/lib/html/pipeline/linuxfr.rb#L8)

0 commit comments

Comments
 (0)