-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yaml
56 lines (54 loc) · 1002 Bytes
/
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
services:
dev:
command:
- npm
- run
- dev
environment:
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
environment:
NPM_CONFIG_CACHE: ${NPM_CONFIG_CACHE:-/home/node/.npm}
expose:
- 8000
image: node:lts-slim
networks:
- prod
ports:
- 8000: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
networks:
dev:
prod: