1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-26 13:48:53 +08:00

Added Docker file

This commit is contained in:
Drasko DRASKOVIC 2015-07-26 23:39:09 +02:00
parent c8c61bfe4a
commit fc410bd89f
3 changed files with 59 additions and 3 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
.git
node_modules
test

42
Dockerfile Normal file
View File

@ -0,0 +1,42 @@
###
# Mainflux Dockerfile
###
# Set the base image to Node, onbuild variant: https://registry.hub.docker.com/_/node/
FROM node:0.10-onbuild
# Maintained by Mainflux team
MAINTAINER Mainflux <docker@mainflux.com>
# Log info
RUN echo "Starting Mainflux server..."
###
# Installations
###
# Add Gulp globally
RUN npm install -g gulp
# Gulp also demands to be saved locally
RUN npm install --save-dev gulp
# Finally, install all project Node modules
RUN npm install
###
# Setup the port
###
# Run Mainflux on port 80
ENV PORT 80
# Expose port on which we run Mainflux
EXPOSE $PORT
###
# Run main command from entrypoint and parameters in CMD[]
###
# Default port to execute the entrypoint (MongoDB)
CMD [""]
# Set default container command
ENTRYPOINT gulp

View File

@ -1,17 +1,28 @@
# Mainflux
Mainflux is an open source MIT licensed IoT cloud written in NodeJS
# Run
## Run
## Install Node Modules
### Install Node Modules
```bash
npm install
```
## Run Gulp Task
### Run Gulp Task
```bash
gulp
```
## Docker
### Build image
```bash
sudo docker build -t=mainflux .
```
## Run image
```bash
sudo docker run -i -t -d -p 8080:8080 --name=mainflux mainflux`
```
## License
MIT