-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
35 lines (33 loc) · 1.18 KB
/
docker-compose.yaml
File metadata and controls
35 lines (33 loc) · 1.18 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
version: '3.1'
services:
ui-admin-panel:
container_name: ui-admin-panel-instance
build: .
environment:
- NODE_ENV=development
- UI_ADMIN_PANEL_DEV_SERVER_PORT=9000
ports:
- "9000:9000"
volumes:
- .:/usr/src/app/:rw
# If node_modules/ does not exist in the current directory
# of host machine, we copy pre-install(during docker build)
# node_modules/ folder from the container to the current directory
# of the host machine.
# ****************************************************************
# BEFORE YOU RUN this file for the first time, make sure you remove
# node_modules/ folder on your host machine, othervise the machine
# dependent node_modules/ folder will be mounted to the
# container, so in that case there will be no point of using
# docker containers for shipping re-usable software.
# ****************************************************************
command: >
sh -c '
if test -d node_modules; \
then \
echo node_modules_exists; \
else \
cp -a /tmp/node_modules /usr/src/app; \
fi && \
npm install && \
dumb-init npm start'