Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM python:2

WORKDIR /root/app/

RUN pip install --upgrade pip
RUN pip install setuptools gunicorn waitress watchdog flask pycrypto futures

COPY . .
COPY d-note-docker.ini /etc/dnote/d-note.ini

RUN python ./setup.py install

RUN generate_dnote_hashes

EXPOSE "8080"

ENTRYPOINT [ "/root/app/run" ]
15 changes: 15 additions & 0 deletions d-note-docker.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# d-note configuration file
# structured in INI style
# use %% to allow code interpolation
# use % to use config interpolation

[DEFAULT]
app = dnote
config_path = /etc/dnote
data_dir = /var/lib/dnote/data

[dnote]
# intentionally left blank.
# Used to interpolate defaults above when they don't get used in another category below


17 changes: 17 additions & 0 deletions run
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

while true
do
export PYTHONPATH=/root/app/;
exec gunicorn dnote:DNOTE \
--bind=0.0.0.0:8080 \
--name=dnote \
--pythonpath=$PYTHONPATH \
--proxy-allow-from='*' \
--access-logfile='-' \
--error-logfile='-' \
--threads=2 \
--workers=2 \
--worker-class=sync;
echo "Crashed with code: $?";
done