Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1bb35ef

Browse filesBrowse files
committed
Add composable environment for running local metacpan-api
If using plain docker-compose, running export COMPOSE_PROJECT_NAME=metacpan export COMPOSE_FILE="docker-compose.yml:docker-compose.localapi.yml" docker-compose up Will set up a complete MetaCPAN environment with both the frontend (http://localhost;5001) and backend (http://localhost:5000) as well as ElasticSearch (http://localhost:9200) online. This makes use the previous `docker-compose.yml` configuration, _composing_ in further settings for the local API to happen. But that's a mouthful, so use `bin/metacpan-docker` to make all that simple instead. See the [compose CLI][0] [docs][1] for the gory details. [0]: https://docs.docker.com/compose/reference/envvars/ [1]: https://docs.docker.com/compose/reference/overview/#use--f-to-specify-name-and-path-of-one-or-more-compose-files
1 parent 3068e27 commit 1bb35ef
Copy full SHA for 1bb35ef

File tree

Expand file treeCollapse file tree

1 file changed

+64
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+64
-0
lines changed

‎docker-compose.localapi.yml

Copy file name to clipboard
+64Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
version: '3'
2+
services:
3+
web:
4+
depends_on:
5+
- api
6+
environment:
7+
- NET_ASYNC_HTTP_MAXCONNS=1
8+
volumes:
9+
- ./configs/metacpan-web/metacpan_web.conf:/metacpan-web/metacpan_web.conf
10+
api:
11+
depends_on:
12+
- elasticsearch
13+
- elasticsearch_test
14+
image: metacpan-api:latest
15+
build:
16+
context: ./src/metacpan-api
17+
environment:
18+
- COLUMNS=80
19+
- ES=elasticsearch:9200
20+
- ES_TEST=elasticsearch_test:9200
21+
- MINICPAN=/CPAN
22+
- PLACK_ENV=development
23+
volumes:
24+
- cpan:/CPAN
25+
- api_carton:/carton
26+
- ./src/metacpan-api:/metacpan-api
27+
- ./configs/metacpan-api/metacpan_server.conf:/metacpan-api/metacpan_server.conf
28+
- ./configs/metacpan-api/metacpan.pl:/metacpan-api/etc/metacpan.pl
29+
- ./bin/index-cpan.sh:/bin/index-cpan.sh
30+
- ./bin/partial-cpan-mirror.sh:/bin/partial-cpan-mirror.sh
31+
ports:
32+
- "5000:5000"
33+
networks:
34+
- elasticsearch
35+
- web
36+
elasticsearch:
37+
image: elasticsearch:2.4
38+
volumes:
39+
- elasticsearch:/usr/share/elasticsearch/data
40+
- ./elasticsearch/metacpan.yml:/usr/share/elasticsearch/config/metacpan.yml
41+
- ./elasticsearch/scripts:/usr/share/elasticsearch/config/scripts
42+
ports:
43+
- "9200:9200"
44+
networks:
45+
- elasticsearch
46+
elasticsearch_test:
47+
image: elasticsearch:2.4
48+
volumes:
49+
- elasticsearch_test:/usr/share/elasticsearch/data
50+
- ./elasticsearch/test.yml:/usr/share/elasticsearch/config/test.yml
51+
- ./elasticsearch/scripts:/usr/share/elasticsearch/config/scripts
52+
ports:
53+
- "9900:9200"
54+
networks:
55+
- elasticsearch
56+
57+
networks:
58+
elasticsearch:
59+
60+
volumes:
61+
api_carton:
62+
cpan:
63+
elasticsearch:
64+
elasticsearch_test:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.