-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
82 lines (76 loc) · 2.12 KB
/
Copy pathdocker-compose.yml
File metadata and controls
82 lines (76 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
services:
backend:
image: registry.gitlab.com/adaptivestone/ubuntu-node:latest
volumes:
- ./:/var/www/
working_dir: /var/www
ports:
- 3300:3300
- 9229:9229
depends_on:
- mongo
- redis
environment:
MONGO_DSN: mongodb://mongo/ads-framework?replicaSet=rs0
REDIS_URI: redis://redis
EMAIL_HOST: mail
EMAIL_PORT: 1025
command: "npm run docker"
# Second runtime: run the test suite under Bun (framework >= 5.4 is certified
# on Bun >= 1.4). Node stays the primary runtime; this service exists only to
# prove the same sources pass on both.
#
# docker compose run --rm backend-bun
#
# It shares the project volume, and therefore the node_modules the `backend`
# service installed — Bun reads the same tree. It reuses the `mongo` service
# instead of starting a database of its own: `bun test` has no equivalent of
# Node's `--test-global-setup`, so the URI is handed over through the
# env var the framework test bootstrap reads. `__DB_TO_REPLACE__` is the
# placeholder each test file swaps for its own database name.
backend-bun:
image: oven/bun:1.4
profiles: ["bun"]
volumes:
- ./:/var/www/
working_dir: /var/www
depends_on:
mongo:
condition: service_healthy
environment:
TEST_MONGO_URI: mongodb://mongo/__DB_TO_REPLACE__?replicaSet=rs0
LOGGER_CONSOLE_LEVEL: error
command: ["bash", "scripts/bun-test.sh"]
mongo:
image: mongo:8.2
volumes:
- mongodata:/data/db
- ./dump:/dump
ports:
- 27017:27017
entrypoint:
[
'/usr/bin/mongod',
'--bind_ip_all',
'--wiredTigerCacheSizeGB',
'1',
'--replSet',
'rs0'
]
healthcheck:
test: test $$(mongosh --quiet --eval "try {rs.initiate({_id:'rs0',members:[{_id:0,host:'mongo:27017'}]})} catch(e) {rs.status().ok}") -eq 1
interval: 10s
retries: 5
redis:
image: redis
ports:
- 6379:6379
# dev to check email
mail:
image: axllent/mailpit
ports:
- 1025:1025
- 8025:8025
volumes:
mongodata:
driver: local