22
33[ ![ CircleCI] ( https://circleci.com/gh/metacpan/metacpan-docker.svg?style=svg )] ( https://circleci.com/gh/metacpan/metacpan-docker )
44
5- ![ docker- compose up] ( https://github.com/metacpan/metacpan-docker/workflows/docker-compose%20up/badge.svg?branch=master )
5+ ![ docker compose up] ( https://github.com/metacpan/metacpan-docker/workflows/docker-compose%20up/badge.svg?branch=master )
66
77<!-- vim-markdown-toc GFM -->
88
@@ -80,8 +80,8 @@ command:
8080
8181 docker pull elasticsearch:2.4 --platform=linux/x86_64
8282
83- It is highly recommended that you alias ` docker- compose ` to ` fig ` (its original
84- name) and use it wherever ` docker- compose ` is used. You are going to have to
83+ It is highly recommended that you alias ` docker compose ` to ` fig ` (its original
84+ name) and use it wherever ` docker compose ` is used. You are going to have to
8585type this command a lot.
8686
8787Then, clone this repo and set up the environment:
@@ -101,10 +101,10 @@ These repositories are automatically mounted into the appropriate docker
101101containers allowing the developer to use their preferred tools to work with the
102102source code.
103103
104- The ` docker- compose up ` command on its own will bring up the entire stack in the
104+ The ` docker compose up ` command on its own will bring up the entire stack in the
105105foreground (logs will be displayed).
106106
107- The ` docker- compose up ` command will also fetch the official container images
107+ The ` docker compose up ` command will also fetch the official container images
108108from [ MetaCPAN Docker Hub] ( https://cloud.docker.com/u/metacpan/repository/list )
109109repositories.
110110
@@ -115,7 +115,7 @@ Docker) and run the services.
115115Don't forget to seed the local ` metacpan-api ` with a partial CPAN; run the
116116following command in a separate terminal to get yourself up to speed:
117117
118- docker- compose exec api index-cpan.sh
118+ docker compose exec api index-cpan.sh
119119
120120This will prompt you to confirm removing old indices and setting up mappings on
121121the Elasticsearch service (say ` YES ` ). It will then proceed to rsync a partial
@@ -128,7 +128,7 @@ elsewhere.
128128Alternatively, if you just want to hack on the web frontend, you can run this
129129instead of all the above:
130130
131- docker- compose up web
131+ docker compose up web
132132
133133From here, you can proceed and hack on the MetaCPAN code at ` src/metacpan-api `
134134and/or ` src/metacpan-web ` directories, and saving edits will reload the
@@ -137,7 +137,7 @@ corresponding apps automatically!
137137When done hacking (or, more likely, when you need to rebuild/refresh your Docker
138138environment) you can then run
139139
140- docker- compose down
140+ docker compose down
141141
142142in another terminal to stop all MetaCPAN services and remove the containers.
143143
@@ -150,26 +150,26 @@ For further details, read on!
150150You can (re)build arbitrary containers. For instance, if you want to rebuild the
151151` api ` container:
152152
153- docker- compose build api
153+ docker compose build api
154154
155155### Accessing Containers
156156
157- Containers are accessible via the ` docker- compose exec ` command followed by the
157+ Containers are accessible via the ` docker compose exec ` command followed by the
158158container and then the command to execute. For example, to start a shell prompt
159159in the ` api ` container:
160160
161- docker- compose exec api /bin/bash
161+ docker compose exec api /bin/bash
162162
163163Executing tests via ` prove ` inside the API container:
164164
165- docker- compose exec api_test prove -lvr \
165+ docker compose exec api_test prove -lvr \
166166 t/00_setup.t \
167167 t/01_darkpan.t \
168168 t/api/controller/cover.t
169169
170170To access the ` psql ` command line client in the PostgreSQL container:
171171
172- docker- compose exec pgdb psql
172+ docker compose exec pgdb psql
173173
174174### Accessing Services
175175
@@ -217,11 +217,11 @@ directly. They are available via the `api` and `api_test` containers.
217217
218218You can query the ` elasticsearch ` container via:
219219
220- docker- compose exec elasticsearch curl http://localhost:9200
220+ docker compose exec elasticsearch curl http://localhost:9200
221221
222222You can query the ` elasticsearch_test ` container via:
223223
224- docker- compose exec elasticsearch_test curl http://localhost:9200
224+ docker compose exec elasticsearch_test curl http://localhost:9200
225225
226226#### ` PostgreSQL `
227227
@@ -267,21 +267,21 @@ These services use one or more Docker volumes:
267267[ 4 ] : https://metacpan.org/pod/Carton
268268
269269Docker Compose is used to, uh, _ compose_ them all together into one system.
270- Using ` docker- compose ` directly is a mouthful, however, so putting this all
270+ Using ` docker compose ` directly is a mouthful, however, so putting this all
271271together is done via the ` bin/metacpan-docker ` script to simplify setup and
272272usage (and to get you started hacking on the MetaCPAN sooner!)
273273
274274### The ` bin/metacpan-docker ` script
275275
276- ` bin/metacpan-docker ` is a thin wrapper around the ` docker- compose ` command,
276+ ` bin/metacpan-docker ` is a thin wrapper around the ` docker compose ` command,
277277providing the environment variables necessary to run a basic MetaCPAN
278278environment. It provides these subcommands:
279279
280280#### ` bin/metacpan init `
281281
282282The ` init ` subcommand basically clones the [ metacpan-api] [ 5 ] and
283283[ metacpan-web] [ 6 ] repositories, and sets up the git commit hooks for each of
284- them, in preparation for future ` docker- compose ` or
284+ them, in preparation for future ` docker compose ` or
285285` bin/metacpan-docker localapi ` commands.
286286
287287It also clones the ` metacpan-grep-front-end ` and ` metacpan-cpan-extracted-lite `
@@ -292,12 +292,12 @@ repositories.
292292
293293#### ` bin/metacpan localapi `
294294
295- The ` localapi ` subcommand adds the necessary configuration for ` docker- compose `
295+ The ` localapi ` subcommand adds the necessary configuration for ` docker compose `
296296to run both the ` metacpan-web ` and ` metacpan-api ` services, along with
297297` elasticsearch ` and Docker volumes. Under the hood, it customizes the
298298` COMPOSE_FILE ` and ` COMPOSE_PROJECT_NAME ` environment variables used by
299- ` docker- compose ` to use additional YAML configuration files aside from the
300- default ` docker- compose.yml ` .
299+ ` docker compose ` to use additional YAML configuration files aside from the
300+ default ` docker compose.yml ` .
301301
302302#### ` bin/metacpan-docker pull `
303303
@@ -314,8 +314,8 @@ command.
314314#### ` bin/metacpan-docker ` build/up/down/start/stop/run/ps/top...
315315
316316As noted earlier, ` bin/metacpan-docker ` is a thin wrapper around
317- ` docker- compose ` , so commands like ` up ` , ` down ` , and ` run ` will work as expected
318- from ` docker- compose ` . See the [ docker- compose docs] [ 7 ] for an overview of
317+ ` docker compose ` , so commands like ` up ` , ` down ` , and ` run ` will work as expected
318+ from ` docker compose ` . See the [ docker compose docs] [ 7 ] for an overview of
319319available commands.
320320
321321[ 7] :
@@ -329,8 +329,8 @@ The `web` service is a checkout of `metacpan-web`, built as a Docker image.
329329Running this service alone is enough if you want to just hack on the frontend,
330330since by default the service is configured to talk to
331331[ https://fastapi.metacpan.org ] ( https://fastapi.metacpan.org ) for its backend; if
332- this is what you want, then you can simply invoke ` docker- compose up ` or
333- ` docker- compose up web ` .
332+ this is what you want, then you can simply invoke ` docker compose up ` or
333+ ` docker compose up web ` .
334334
335335#### ` api `
336336
@@ -396,7 +396,7 @@ the [metacpan-puppet][10] repository. The `api` service depends on the
396396### Running your own miniCPAN inside metacpan-docker
397397
398398Suppose you have a local minicpan in ` /home/ftp/pub/CPAN ` . If you would like to
399- use this in ` metacpan-docker ` , then edit the ` docker- compose.localapi.yml ` to
399+ use this in ` metacpan-docker ` , then edit the ` docker compose.localapi.yml ` to
400400change the ` api ` service's volume mounts to use your local minicpan as ` /CPAN ` ,
401401e.g.:
402402
@@ -450,7 +450,7 @@ You can use `bin/metacpan-docker pull` to update all `src/*` directories.
450450
451451### Running Kibana to peek into Elasticsearch data
452452
453- By default, the ` docker- compose.localapi.yml ` configures the ` elasticsearch `
453+ By default, the ` docker compose.localapi.yml ` configures the ` elasticsearch `
454454service to listen on the Docker host at
455455[ http://localhost:9200 ] ( http://localhost:9200 ) , and is also accessible via the
456456Docker ` default ` network address of
0 commit comments