Commit 2c60994b authored by Michał 'rysiek' Woźniak's avatar Michał 'rysiek' Woźniak
Browse files

initial import, already working

parents
FROM debian:jessie
MAINTAINER Michał "rysiek" Woźniak <rysiek@hackerspace.pl>
ENV DEBIAN_FRONTEND noninteractive
# install the required packages
RUN apt-get update && \
apt-get install -y --no-install-recommends \
nodejs \
ca-certificates \
npm \
curl \
--no-install-recommends && \
rm -rf /var/lib/apt/lists/*
# yeah, we need that because bin/installDeps.sh looks for node
# and debian has nodejs
RUN ln -s /usr/bin/nodejs /usr/bin/node
# get the newest nodejs version
RUN npm cache clean -f && npm install -g n && n stable
# make it sane, security-wise
RUN mkdir -p /opt/hazel /opt/hazel/config /opt/hazel/themes/default/public /opt/hazel/uploads /opt/hazel/content /opt/hazel/data && \
groupadd -r hazel && \
useradd -d /opt/hazel -r -g `getent group hazel | cut -d: -f3` hazel
# yay, clone the repo!
RUN cd /opt/hazel && npm install hazel-wiki --save && cp -a /opt/hazel/node_modules/hazel-wiki/app/themes/default/ /opt/hazel/themes/
COPY ./server.js /opt/hazel/
COPY ./config.default.js /opt/hazel/config/
# install the deps
# sync used due to a bug in Docker, working around "text file busy" error
RUN cd /opt/hazel/ && \
chown -R hazel:hazel ./
# entrypoint script
#COPY start.sh /opt/hazel/start.sh
#RUN chmod ug+x /opt/hazel/start.sh
# expose, volume
EXPOSE 3000
VOLUME ["/opt/hazel/config/", "/opt/hazel/themes/", "/opt/hazel/uploads/", "/opt/hazel/content/", "/opt/hazel/data/", "/var/log/hazel/"]
# user, workdir
USER hazel
WORKDIR "/opt/hazel"
# command
#CMD ["/opt/hazel/start.sh"]
CMD ["/usr/bin/node", "server.js"]
\ No newline at end of file
This diff is collapsed.
"use strict";
//
// based on:
// https://github.com/wkallhof/Hazel/blob/master/app/config.default.js
//
const basedir = '/opt/hazel'
var config = {
// Your site title (format: page_title | site_title)
site_title: "HAZEL",
// Your site sections for homepage. For each section below, the home page
// will display a section box that lists the document count for documents
// that have a matching tag. Clicking the section link will list the documents.
site_sections: [
// {
// 'title': 'Tenuatus',
// 'description': 'In tellus solent, me caelum ripis, ducere licebit fovebat.',
// 'tag': 'manual'
// },
// {
// 'title': 'Canentem',
// 'description': 'Quis admoverat ferunt nusquam potiere, virtute.',
// 'tag': 'team'
// },
// {
// 'title': 'Timor',
// 'description': 'Ore divite ingemuit ingredior, rediturum!',
// 'tag': 'faq'
// }
],
// Excerpt length (used in search)
excerpt_length: 400,
//Application base url. While most of the application uses relative paths
//for routing, this is used for things like SEO which require absolute URLs
base: "/",
// Specify the theme to use
theme_dir: basedir + "/themes/",
theme_name: "default",
// Path in which to store uploads (images etc.)
uploads_dir: basedir + "/uploads/",
// Path in which to store content (markdown files, etc.)
content_dir: basedir + "/content/",
// Path in which to store data (analytics, etc.)
data_dir: basedir + "/data/",
// Path to the static file directory for themes
public_dir: basedir + "/themes/default/public/",
// Optional Lunr locale
lunr_locale: "",
// Secret key used to sync two servers
sync_key: "",
// Set to true to enable HTTP Basic Authentication
authentication: false,
// Set the Authentication mode. Options:
// - "all" : Requires authentication for all pages
// - "admin" : Requires authentication for only admin pages (edit / save / etc.).
// This allows for a public facing site
authentication_mode: "all",
// If using authentication, set the username and password here.
credentials: {
username: "",
password: ""
}
};
module.exports = config;
"use strict";
const Hazel = require("hazel-wiki").app;
const config = require("./config/config.default.js");
const StorageProvider = require("hazel-wiki").storageProvider;
let app = new Hazel(config, StorageProvider);
let server = app.server;
server.listen(3000, () => {
console.log("✔ Hazel server listening at 3000 ");
});
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment