-
Notifications
You must be signed in to change notification settings - Fork 61
/
docker-compose.test.yml
93 lines (92 loc) · 2.46 KB
/
docker-compose.test.yml
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
83
84
85
86
87
88
89
90
91
92
93
version: '3.8'
services:
postgres:
environment: &env
NODE_ENV: test
NEST_PORT: 3003
BACKEND_URL: http://localhost:3000
FRONTEND_URL: http://localhost:4200
CDN_URL: http://minio:9000/momtest
POSTGRES_USER: root
POSTGRES_DB: momentum
POSTGRES_PASSWORD: root
POSTGRES_PORT: 5432
DATABASE_URL: postgresql://root:root@postgres/momentum?schema=public
MINIO_SITE_REGION: us-west-1
MINIO_SERVER_PORT: 9000
MINIO_CONSOLE_PORT: 9001
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
STORAGE_REGION: us-west-1
STORAGE_BUCKET_NAME: momtest
STORAGE_ACCESS_KEY_ID: minio
STORAGE_SECRET_ACCESS_KEY: minio123
STORAGE_ENDPOINT_URL: http://minio:9000
STEAM_WEB_API_KEY: thisisenoughtogenerateanopenidreferralforsomereason
SESSION_SECRET: thisisashitsecretdontuseitinprod
JWT_SECRET: thisisalsonotasecure
ports:
- "5432:5432"
minio:
environment:
<<: *env
ports:
- "9000:9000"
- "9001:9001"
command: server /data --console-address ":9001"
healthcheck:
test: ['CMD', 'curl', '-f', 'http://minio:9000/minio/health/live']
interval: 5s
timeout: 20s
retries: 3
createbuckets:
environment:
<<: *env
entrypoint: >
bash -c "
mc alias set momentum_minio http://minio:9000 minio minio123 &&
mc mb momentum_minio/momtest --ignore-existing &&
mc anonymous set public momentum_minio/momtest
"
backend-e2e:
# If we used `node-alpine` here we'd need to redownload our node_modules,
# as some binaries are slightly different. About the same bandwidth for that
# as to download the larger (Debian based) `node` image, and that's a bit
# simpler.
image: node:20.15.0-alpine
depends_on:
- postgres
- minio
- createbuckets
environment:
<<: *env
working_dir: /app/
volumes:
- ./:/app/
ports:
- "3000:3000"
command: >
sh -c "
npm install &&
npx nx run db:deploy &&
npx nx run backend-e2e:e2e
"
frontend-e2e:
image: cypress/base:18.16.0
depends_on:
- postgres
- minio
- createbuckets
environment:
<<: *env
working_dir: /app/
volumes:
- ./:/app/
ports:
- "3001:3001"
command: >
sh -c "
./node_modules/.bin/cypress install &&
npx nx run db:push &&
npx nx run frontend-e2e:e2e
"