-
Notifications
You must be signed in to change notification settings - Fork 85
/
docker-compose.test.yml
66 lines (61 loc) · 1.62 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
version: '3.8'
# for api integration tests (with db) - use as is
# for Cypress e2e tests - is base to extend
services:
npb-app-test:
# image name, set it everywhere
image: npb-app-test
container_name: npb-app-test
build:
context: .
dockerfile: Dockerfile.test
# container:app-process
ports:
- '3001:3001'
# user: '${MY_UID}:${MY_GID}'
volumes:
# no src in Dockerfile, only via mount
# must see src changes, frontend build prod
# to avoid rebuilding container on src change
- ./:/app
- npb-app-test-node_modules:/app/node_modules
- npb-app-test-next:/app/.next
- npb-app-test-dist:/app/dist
env_file:
- ./envs/test-docker/.env.test.docker
- ./envs/test-docker/.env.test.docker.local
depends_on:
- npb-db-test
networks:
- internal-test
npb-db-test:
image: postgres:14.3-bullseye
container_name: npb-db-test
restart: unless-stopped
# entrypoint: sh -c 'whoami && id'
# change internal port
command: postgres -p 5435
user: '${MY_UID}:${MY_GID}'
# expose it to host
ports:
- '5435:5435'
volumes:
- ./prisma/pg-data:/var/lib/postgresql/data
# only: POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB
environment:
- PGDATA=/var/lib/postgresql/data/data-test
env_file:
- ./envs/test-docker/.env.test.docker.local
networks:
- internal-test
- external-host
volumes:
npb-app-test-node_modules:
npb-app-test-next:
npb-app-test-dist:
networks:
internal-test:
external: false
# for adminer dev d-c
external-host:
external: true