Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
89 lines (84 loc) · 2.74 KB
/
Copy pathdocker-compose.yml
File metadata and controls
89 lines (84 loc) · 2.74 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
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
# Node major version for the dev containers: set NODE_VERSION (shell or root .env) to try another, and keep the default in line with .nvmrc
services:
backend:
image: node:${NODE_VERSION:-24}-alpine
working_dir: /backend-express
volumes:
- ./backend-express:/backend-express
- /backend-express/node_modules
- ./commons:/commons
- ./data:/data
ports:
- "3001:3001"
environment:
- DB_HOST=postgres
- DB_PORT=5432
- DB_NAME=data_visualizer
- DB_USERNAME=postgres
- DB_PASSWORD=postgres
- SHINY_URL=http://shiny:3838
- SHINY_SECRET=${SHINY_SECRET:?set SHINY_SECRET in .env (see .env.example)}
# Uploads are processed by the preprocess service below, which picks jobs up from this shared folder (inside ./data)
- PREPROCESS_SPOOL_DIR=/data/jobs
command: sh -c "rm -rf dist/ &&
npm install &&
npm run build &&
npm run db:migrate &&
npm run db:seed &&
npm run dev"
depends_on:
postgres:
condition: service_healthy
extra_hosts:
- "host.docker.internal:host-gateway"
restart: on-failure
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: data_visualizer
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
restart: on-failure
# Only reachable from other services (no ports:); Express proxies to http://shiny:3838
shiny:
build: ./shiny
volumes:
- ./shiny/app:/srv/shiny-server/app
- ./data/parquet:/data/parquet:ro
- ./data/uploads/tissue:/data/tissue:ro
environment:
- PARQUET_DIR=/data/parquet
- TISSUE_DIR=/data/tissue
- SHINY_SECRET=${SHINY_SECRET:?set SHINY_SECRET in .env (see .env.example)}
- SHINY_DEV=1
# Turns uploaded .rds files into the Parquet the Shiny app reads: waits for jobs the backend drops in data/jobs and runs
# preprocess.R on each (see shiny/preprocess/worker.sh). Needs RAM for the largest Seurat object (often 2-5x its file size)
preprocess:
build: ./shiny/preprocess
image: preprocess
entrypoint: ["/worker.sh"]
volumes:
- ./data:/data
- ./shiny/preprocess/preprocess.R:/preprocess.R:ro
restart: unless-stopped
frontend:
image: node:${NODE_VERSION:-24}-alpine
working_dir: /app
volumes:
- ./frontend:/app
- /app/node_modules
- ./commons:/commons
ports:
- "3000:3000"
command: sh -c "npm install && npm run dev --host"
volumes:
postgres-data: