1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-16 03:48:44 +00:00

add nodebb

This commit is contained in:
kev 2016-01-16 07:19:42 +08:00
parent 5fe4483a78
commit 3cd51c7cbc
11 changed files with 203 additions and 2 deletions

@ -14,7 +14,6 @@ dockerfiles
- [ ] gitolite
- [ ] hashcat
- [ ] irc
- [ ] nodebb
- [ ] tshark
## DONE
@ -53,6 +52,7 @@ dockerfiles
- [x] nginad
- [x] nginx
- [x] ngrok :+1:
- [x] nodebb
- [x] node-red :+1:
- [x] node-red-arm :+1:
- [x] obfsproxy

@ -2,7 +2,7 @@
# Dockerfile for ghost-arm
#
FROM vimagick/alpine-arm:edge
FROM vimagick/alpine-arm
MAINTAINER kev <noreply@datageek.info>
ENV GHOST_VER 0.7.5

40
nodebb/Dockerfile Normal file

@ -0,0 +1,40 @@
#
# Dockerfile for nodebb
#
FROM alpine
MAINTAINER kev <noreply@datageek.info>
ENV BB_VER 0.9.3
ENV BB_URL https://github.com/NodeBB/NodeBB/archive/v$BB_VER.tar.gz
ENV BB_SOURCE /usr/src/nodebb
ENV BB_CONTENT /var/lib/nodebb
WORKDIR $BB_SOURCE
VOLUME $BB_CONTENT
RUN set -ex \
&& apk add -U bash \
imagemagick \
nodejs \
openssl \
&& apk add -t TMP build-base \
curl \
git \
openssl-dev \
python \
tar \
&& curl -sSL $BB_URL | tar xz --strip 1 \
&& sed -i '/"bufferutil": {/,/},/d; /"utf-8-validate": {/,/},/d' npm-shrinkwrap.json \
&& npm install --production \
&& npm cache clean \
&& apk del TMP \
&& rm -rf /tmp/npm* \
/var/cache/apk/*
COPY config.example.json $BB_SOURCE
COPY docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 4567
CMD ["npm", "start"]

33
nodebb/README.md Normal file

@ -0,0 +1,33 @@
nodebb
======
![](https://badge.imagelayers.io/vimagick/nodebb:latest.svg)
[NodeBB][1] Forum Software is powered by Node.js and built on either a Redis or MongoDB database.
## docker-compose.yml
```
nodebb:
image: vimagick/nodebb
ports:
- "4567:4567"
links:
- redis
restart: always
redis:
image: redis
ports:
- "127.0.0.1:6379:6379"
restart: always
```
## up and running
```
$ docker-compose up -d
$ firefox http://localhost:4567
```
[1]: https://nodebb.org/

40
nodebb/arm/Dockerfile Normal file

@ -0,0 +1,40 @@
#
# Dockerfile for nodebb-arm
#
FROM vimagick/alpine-arm
MAINTAINER kev <noreply@datageek.info>
ENV BB_VER 0.9.3
ENV BB_URL https://github.com/NodeBB/NodeBB/archive/v$BB_VER.tar.gz
ENV BB_SOURCE /usr/src/nodebb
ENV BB_CONTENT /var/lib/nodebb
WORKDIR $BB_SOURCE
VOLUME $BB_CONTENT
RUN set -ex \
&& apk add -U bash \
imagemagick \
nodejs \
openssl \
&& apk add -t TMP build-base \
curl \
git \
openssl-dev \
python \
tar \
&& curl -sSL $BB_URL | tar xz --strip 1 \
&& sed -i '/"bufferutil": {/,/},/d; /"utf-8-validate": {/,/},/d' npm-shrinkwrap.json \
&& npm install --production \
&& npm cache clean \
&& apk del TMP \
&& rm -rf /tmp/npm* \
/var/cache/apk/*
COPY config.example.json $BB_SOURCE
COPY docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 4567
CMD ["npm", "start"]

@ -0,0 +1,11 @@
{
"url": "http://localhost:4567",
"secret": "SECRET",
"database": "redis",
"redis": {
"host": "redis",
"port": "6379",
"password": "",
"database": "0"
}
}

@ -0,0 +1,13 @@
nodebb:
image: vimagick/nodebb-arm
ports:
- "4567:4567"
links:
- redis
restart: always
redis:
image: redis
ports:
- "127.0.0.1:6379:6379"
restart: always

20
nodebb/arm/docker-entrypoint.sh Executable file

@ -0,0 +1,20 @@
#!/bin/bash
set -e
export NODE_ENV=production
export silent=false
export daemon=false
if [[ "$*" == npm*start* ]]; then
if [ ! -e "$BB_CONTENT/config.json" ]; then
sed "s/SECRET/$(node -e 'console.log(require("node-uuid").v4())')/" \
"$BB_SOURCE/config.example.json" > "$BB_CONTENT/config.json"
npm install connect-redis
fi
ln -sf "$BB_CONTENT/config.json" "$BB_SOURCE/config.json"
exec "$@"
fi
exec "$@"

@ -0,0 +1,11 @@
{
"url": "http://localhost:4567",
"secret": "SECRET",
"database": "redis",
"redis": {
"host": "redis",
"port": "6379",
"password": "",
"database": "0"
}
}

13
nodebb/docker-compose.yml Normal file

@ -0,0 +1,13 @@
nodebb:
image: vimagick/nodebb
ports:
- "4567:4567"
links:
- redis
restart: always
redis:
image: redis
ports:
- "127.0.0.1:6379:6379"
restart: always

20
nodebb/docker-entrypoint.sh Executable file

@ -0,0 +1,20 @@
#!/bin/bash
set -e
export NODE_ENV=production
export silent=false
export daemon=false
if [[ "$*" == npm*start* ]]; then
if [ ! -e "$BB_CONTENT/config.json" ]; then
sed "s/SECRET/$(node -e 'console.log(require("node-uuid").v4())')/" \
"$BB_SOURCE/config.example.json" > "$BB_CONTENT/config.json"
npm install connect-redis
fi
ln -sf "$BB_CONTENT/config.json" "$BB_SOURCE/config.json"
exec "$@"
fi
exec "$@"