Skip to content

Commit 4ea3c67

Browse files
committed
docker-compose setup
1 parent 52c36ce commit 4ea3c67

File tree

4 files changed

+27
-8
lines changed

4 files changed

+27
-8
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git

Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ ARG DEBIAN_FRONTEND=noninteractive
88
RUN npm install -g bower
99
RUN npm install
1010

11-
RUN adduser modular
12-
RUN chown -R modular:modular /app
13-
USER modular
11+
#RUN adduser --disabled-password --gecos "" modular
1412

13+
RUN chown -R node:node /app
14+
15+
USER node
16+
WORKDIR /app
1517
RUN bower install
1618

1719
EXPOSE 4000
1820

19-
ENTRYPOINT ["npm", "start"]
21+
USER root
22+
CMD ["npm", "start"]
2023

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,20 @@ AngularJS, Angular2, React and Meteor versions are coming soon.
6262
Some of the components use the new Flexbox Layout module which is available in most modern browsers. Bootstrap4 is used as main framework. Please make sure that it's suitable for you: [Flexbox browser support](http://caniuse.com/#feat=flexbox).
6363

6464
<br>
65+
6566
## Docker
66-
To build the container, you need to install docker and launch the docker daemon.
67+
68+
To build the container, you need to install docker and docker-compose than launch the docker daemon.
6769
After launching the daemon run the following commands from the project folder:
6870

6971
Build the image
7072
```
71-
docker build -t modular-admin .
73+
docker-compose build
7274
```
7375

74-
7576
Launch the container
7677
```
77-
docker run -ti -p 4000:4000 modular-admin:latest
78+
docker-compose up
7879
```
7980

8081
## Development

docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: '2'
2+
3+
services:
4+
node:
5+
build:
6+
context: .
7+
volumes:
8+
- .:/app
9+
# http://jdlm.info/articles/2016/03/06/lessons-building-node-app-docker.html
10+
- /app/node_modules
11+
ports:
12+
# BrowserSync port.
13+
- "4000:4000"
14+

0 commit comments

Comments
 (0)