Skip to content

Commit e57c72d

Browse files
committed
Add docker-compose.yml
1 parent 4e27003 commit e57c72d

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

.github/workflows/build-container.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
cache-from: type=gha
3939
cache-to: type=gha,mode=max
4040
- name: Run Perl tests
41-
run: docker build . -t metacpan/metacpan-ingest && docker compose run ingest env PLACK_ENV=dev prove -lv t
41+
run: docker compose build && docker compose run ingest env PLACK_ENV=dev prove -lv t
4242
- name: Docker meta
4343
id: meta
4444
uses: docker/metadata-action@v5

docker-compose.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
services:
3+
ingest:
4+
build:
5+
context: .
6+
target: test
7+
image: metacpan/metacpan-ingest:test
8+
volumes:
9+
# Mount everything except /app/local
10+
- ./bin:/app/bin
11+
- ./lib:/app/lib
12+
- ./conf:/app/conf
13+
- ./t:/app/t
14+
- ./test_data:/app/test_data
15+
environment:
16+
- PERL5LIB=/app/local/lib/perl5:/app/lib
17+
- PATH=/app/local/bin:$PATH
18+
command: ["prove", "-lv", "t/"]
19+
user: metacpan
20+
depends_on:
21+
elasticsearch_test:
22+
condition: service_healthy
23+
profiles:
24+
- test
25+
- ingest-test
26+
elasticsearch_test:
27+
profiles:
28+
- test
29+
- ingest-test
30+
image: elasticsearch:2.4
31+
environment:
32+
- discovery.type=single-node
33+
volumes:
34+
- type: volume
35+
source: elasticsearch_test
36+
target: /usr/share/elasticsearch/data
37+
healthcheck:
38+
timeout: 5s
39+
start_period: 60s
40+
test: ["CMD", "curl", "--fail", "http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=5s"]
41+
ports:
42+
- "9200"
43+
networks:
44+
- elasticsearch

0 commit comments

Comments
 (0)