mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
Merge pull request #4 from AH-IT-SLTN/master
added Dockerfile for Containerization
This commit is contained in:
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
node_modules
|
||||||
|
npm-debug.log
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,5 +1,5 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
config.json
|
|
||||||
store.json
|
store.json
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
config.json
|
||||||
|
|||||||
19
Dockerfile
Normal file
19
Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
FROM alpine:latest
|
||||||
|
|
||||||
|
RUN mkdir -p /usr/src/
|
||||||
|
#Install Software
|
||||||
|
RUN apk add --update nodejs npm git
|
||||||
|
|
||||||
|
RUN cd /usr/src && git clone https://github.com/orangecoding/fredy.git
|
||||||
|
|
||||||
|
RUN ln -s /usr/src/fredy/conf/ /conf
|
||||||
|
|
||||||
|
RUN cd /usr/src/fredy/ && npm install
|
||||||
|
|
||||||
|
WORKDIR /usr/src/fredy
|
||||||
|
|
||||||
|
EXPOSE 9876
|
||||||
|
|
||||||
|
VOLUME [ "/conf" ]
|
||||||
|
# --no-daemon is required for keeping Container alive
|
||||||
|
CMD node index.js --no-daemon
|
||||||
19
README.md
19
README.md
@@ -145,3 +145,22 @@ You can call the stats http endpoint like this:
|
|||||||
curl http://localhost:9876
|
curl http://localhost:9876
|
||||||
```
|
```
|
||||||
The ports is depending on what you've configured in your config file.
|
The ports is depending on what you've configured in your config file.
|
||||||
|
|
||||||
|
# Docker
|
||||||
|
|
||||||
|
Use the Dockerfile in this Repo to build a Image
|
||||||
|
|
||||||
|
Ex: docker build -t fredy/fredy /path/to/your/Dockerfile
|
||||||
|
|
||||||
|
## Create & Run a Container
|
||||||
|
|
||||||
|
Put your config.json to /path/to/your/conf/
|
||||||
|
|
||||||
|
Ex: docker create --name fredy -v /path/to/your/conf/:/conf -p 9876:9876 fredy/fredy
|
||||||
|
|
||||||
|
## Logs
|
||||||
|
|
||||||
|
You can browse Logs with
|
||||||
|
|
||||||
|
docker logs fredy -f
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user