-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose-e2e.yml
109 lines (100 loc) · 2.65 KB
/
docker-compose-e2e.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
version: "3"
name: bioloop
services:
ui:
image: node:19
volumes:
- ./ui/:/opt/sca/app
- ui_modules:/opt/sca/app/node_modules
ports:
- 127.0.0.1:443:443
working_dir: /opt/sca/app
# command: sh -c "npm install && exec /opt/sca/app/node_modules/.bin/vite --host"
# entrypoint: [ "tail", "-f", "/dev/null" ]
entrypoint:
- sh
- -c
- |
npm install && exec /opt/sca/app/node_modules/.bin/vite --host
api:
image: node:19
# user: ${APP_UID}:${APP_GID}
# build:
# context: ./api
# args:
# APP_UID: ${APP_UID} # read from .env file
# APP_GID: ${APP_GID} # read from .env file
# environment:
# - APP_UID=APP_UID
# - APP_GID=APP_GID
volumes:
- ./api/:/opt/sca/app
- api_modules:/opt/sca/app/node_modules
expose:
- 3030
ports:
- 127.0.0.1:3030:3030
working_dir: /opt/sca/app
# entrypoint: ["tail", "-f", "/dev/null"]
# command: sh -c "sleep infinity"
entrypoint:
- sh
- -c
- |
npm install \
&& npx prisma generate client \
&& exec /opt/sca/app/node_modules/.bin/nodemon --signal SIGTERM src/index.js
healthcheck:
test: ["CMD", "curl", "-f", "127.0.0.1:3030/health"]
extra_hosts:
- "host.docker.internal:host-gateway" # for connecting to services running on localhost of the host network
depends_on:
- postgres
postgres:
image: postgres:14.5
# restart: unless-stopped
environment:
- POSTGRES_USER=appuser
- POSTGRES_PASSWORD=example
- POSTGRES_DB=app
volumes:
- ./db/db_postgres:/var/lib/postgresql/data
- ./db/postgres/scripts:/docker-entrypoint-initdb.d
- ./db/postgres/aux_scripts:/opt/sca/scripts
- ./db/backups:/opt/sca/backups
ports:
- 127.0.0.1:5432:5432
expose:
- 5432
nginx:
image: nginx:1.25
ports:
- 8000:8000
volumes:
- ./nginx/src:/usr/share/nginx/html
- ./nginx/conf:/etc/nginx/conf.d
- ./data:/opt/sca/data
extra_hosts:
- "host.docker.internal:host-gateway" # for connecting to services running on localhost of the host network
e2e:
build: tests
volumes:
- ./tests/:/opt/sca/app
- test_modules:/opt/sca/app/node_modules
entrypoint:
- sh
- -c
- |
/opt/sca/app/node_modules/.bin/playwright test
depends_on:
# ensures that tests don't run until the API container is up
api:
condition: service_healthy
network_mode: "host"
volumes:
ui_modules:
external: false
api_modules:
external: false
test_modules:
external: false