-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
78 lines (74 loc) · 1.48 KB
/
compose.yaml
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
x-database-env-variables: &database-env-variables
DATABASE_URL: postgresql://root@database:26257/defaultdb?sslmode=disable
services:
dev:
command:
- npm
- run
- dev
depends_on:
- database
environment:
<<: *database-env-variables
NPM_CONFIG_CACHE: ${NPM_CONFIG_CACHE:-/home/node/.npm}
expose:
- 3000
image: node:lts-slim
networks:
- dev
ports:
- 3000:3000
tty: true
user: ${HOST_USER_IDS:-1000:1000}
volumes:
- type: bind
source: .
target: /app
- type: bind
source: ~/.npm
target: /home/node/.npm
working_dir: /app
prod:
command:
- /bin/bash
- -c
- |
npm run build
npm run start
depends_on:
- database
environment:
<<: *database-env-variables
NPM_CONFIG_CACHE: ${NPM_CONFIG_CACHE:-/home/node/.npm}
expose:
- 8000
image: node:lts-slim
networks:
- prod
ports:
- 8000:3000
user: ${HOST_USER_IDS:-1000:1000}
volumes:
- type: bind
source: .
target: /app
- type: bind
source: ~/.npm
target: /home/node/.npm
working_dir: /app
database:
command:
- start-single-node
- '--insecure'
- '--store=type=mem,size=0.25'
- '--advertise-addr=localhost'
image: cockroachdb/cockroach
networks:
- dev
- prod
ports:
- 26257:26257
- 8080:8080
networks:
dev:
prod: