Skip to content

Commit

Permalink
store the database connection details and any uploaded files in a vol…
Browse files Browse the repository at this point in the history
…ume. also automatically run the upgrade script at container startup. update NodeBB#4633
  • Loading branch information
BenLubar committed May 12, 2016
1 parent 3fe786e commit c76a139
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,18 @@ ENV NODE_ENV=production \
daemon=false \
silent=false

# nodebb setup will ask you for connection information to a redis (default), mongodb then run the forum
# nodebb upgrade is not included and might be desired
CMD node app --setup && npm start

# the default port for NodeBB is exposed outside the container
EXPOSE 4567

VOLUME /usr/src/app/docker
VOLUME /usr/src/app/public/uploads

# save the config in a volume so the container can be discarded
RUN ln -s /usr/src/app/docker/config.json /usr/src/app/config.json

# make sure the uploads subdirectories exist, run any database migrations,
# and set the container's process as the NodeBB daemon so ./nodebb works
CMD git checkout -- public/uploads \
&& ./nodebb upgrade \
&& echo 1 > pidfile \
&& exec node loader.js

0 comments on commit c76a139

Please sign in to comment.