-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.test.yml
62 lines (56 loc) · 1.41 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
version: '3'
services:
test:
build:
context: .
dockerfile: dev.Dockerfile
ports:
- ${PORT}:${PORT}
image: promise-api:test
container_name: promise-api.test
networks:
- test
depends_on:
mysql:
condition: service_healthy
command: >
sh -c "npx prisma migrate deploy && npx jest"
environment:
TZ: ${TZ}
PORT: ${PORT}
STAGE: ${STAGE}
NODE_ENV: ${NODE_ENV}
JWT_SIGN_KEY: ${JWT_SIGN_KEY}
JWT_VERIFY_KEY: ${JWT_VERIFY_KEY}
INTHASH_KEY: ${INTHASH_KEY}
SQIDS_KEY: ${SQIDS_KEY}
DB_URL: mysql://${DB_USER}:${DB_PASSWORD}@mysql:${DB_PORT}/${DB_NAME}_${STAGE}
mysql:
image: mysql:8.3
container_name: promise-api.mysql.test
ports:
- ${DB_PORT}:3306
networks:
- test
volumes:
- ./dockerdata/mysql.${STAGE}:/var/lib/mysql
- ./mysql:/docker-entrypoint-initdb.d:ro
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --performance-schema=OFF
environment:
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
USER: ${DB_USER}
PASSWORD: ${DB_PASSWORD}
DATABASE: ${DB_NAME}
STAGE: ${STAGE}
TZ: ${TZ}
restart: always
healthcheck:
test: ['CMD-SHELL', 'mysql -uroot -p${DB_PASSWORD} ${DB_NAME}_${STAGE} -e "SELECT 1"']
interval: 3s
timeout: 5s
retries: 10
networks:
test: