-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
63 lines (59 loc) · 1.56 KB
/
docker-compose.test.yml
File metadata and controls
63 lines (59 loc) · 1.56 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
services:
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: alfa
POSTGRES_PASSWORD: alfa
POSTGRES_DB: alfa
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U alfa -d alfa"]
interval: 2s
timeout: 5s
retries: 20
api-test:
build:
context: .
dockerfile: apps/api/Dockerfile
environment:
DATABASE_URL: postgres://alfa:alfa@db:5432/alfa
NODE_ENV: test
S3_ENDPOINT: ${S3_ENDPOINT_TEST:-http://minio:9000}
S3_ACCESS_KEY: ${S3_ACCESS_KEY_TEST:-alfa}
S3_SECRET_KEY: ${S3_SECRET_KEY_TEST:-alfa-minio}
S3_BUCKET: ${S3_BUCKET_TEST:-alfa-evidence}
S3_REGION: ${S3_REGION_TEST:-us-east-1}
depends_on:
db:
condition: service_healthy
minio:
condition: service_started
command: ["/bin/sh", "-c", "npx prisma migrate deploy && npm run test:e2e -- --runInBand"]
minio:
image: minio/minio:latest
environment:
MINIO_ROOT_USER: alfa
MINIO_ROOT_PASSWORD: alfa-minio
command: ["server", "/data", "--console-address", ":9001"]
volumes:
- minio_test_data:/data
minio_init:
image: minio/mc:latest
depends_on:
- minio
entrypoint:
- /bin/sh
- -c
- |
for i in $(seq 1 30); do
if mc alias set local http://minio:9000 alfa alfa-minio; then
break
fi
sleep 1
done
mc mb -p local/alfa-evidence
mc anonymous set none local/alfa-evidence
tail -f /dev/null
volumes:
minio_test_data: