mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
@@ -1,2 +1,3 @@
|
|||||||
node_modules
|
node_modules
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
test
|
||||||
19
Dockerfile
19
Dockerfile
@@ -1,19 +0,0 @@
|
|||||||
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 9998
|
|
||||||
|
|
||||||
VOLUME [ "/conf", "/db" ]
|
|
||||||
# --no-daemon is required for keeping Container alive
|
|
||||||
CMD node index.js --no-daemon
|
|
||||||
@@ -73,7 +73,7 @@ Example: `docker build -t fredy/fredy /path/to/your/Dockerfile`
|
|||||||
|
|
||||||
Put your config.json to `/path/to/your/conf/`
|
Put your config.json to `/path/to/your/conf/`
|
||||||
|
|
||||||
Example: `docker create --name fredy -v /path/to/your/conf/:/conf -p 9988:9988 fredy/fredy`
|
Example: `docker create --name fredy -v /path/to/your/conf/:/conf -p 9998:9998 fredy/fredy`
|
||||||
|
|
||||||
## Logs
|
## Logs
|
||||||
|
|
||||||
|
|||||||
31
build/Dockerfile
Normal file
31
build/Dockerfile
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
FROM alpine:latest AS build
|
||||||
|
# use given repository, default below:
|
||||||
|
ARG repo=https://github.com/orangecoding/fredy.git
|
||||||
|
|
||||||
|
RUN mkdir -p /usr/src/
|
||||||
|
#Install Software
|
||||||
|
RUN apk add --update nodejs npm git
|
||||||
|
|
||||||
|
# Output used repository
|
||||||
|
RUN echo "Cloning from $repo"
|
||||||
|
|
||||||
|
RUN cd /usr/src && git clone $repo
|
||||||
|
|
||||||
|
RUN ln -s /usr/src/fredy/conf/ /conf
|
||||||
|
|
||||||
|
# create db folder
|
||||||
|
RUN mkdir /usr/src/fredy/db/
|
||||||
|
|
||||||
|
RUN ln -s /usr/src/fredy/db/ /db
|
||||||
|
|
||||||
|
RUN cd /usr/src/fredy/ && npm install
|
||||||
|
|
||||||
|
WORKDIR /usr/src/fredy
|
||||||
|
|
||||||
|
RUN npm run prod
|
||||||
|
|
||||||
|
EXPOSE 9998
|
||||||
|
|
||||||
|
VOLUME [ "/conf", "/db" ]
|
||||||
|
# --no-daemon is required for keeping Container alive
|
||||||
|
CMD node index.js --no-daemon
|
||||||
17
docker-compose.yml
Normal file
17
docker-compose.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
version: '3.3'
|
||||||
|
services:
|
||||||
|
fredy:
|
||||||
|
container_name: fredy
|
||||||
|
# build from empty build folder to reduce size of image
|
||||||
|
build:
|
||||||
|
context: ./build
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
args:
|
||||||
|
repo: https://github.com/anbucher/fredy.git
|
||||||
|
image: fredy/fredy
|
||||||
|
# map existing config and database
|
||||||
|
volumes:
|
||||||
|
- ./conf:/conf
|
||||||
|
- ./db:/db
|
||||||
|
ports:
|
||||||
|
- 9998:9998
|
||||||
Reference in New Issue
Block a user