Skip to content

Commit 9174d90

Browse files
committed
dmsh template first draft
0 parents  commit 9174d90

File tree

6 files changed

+64
-0
lines changed

6 files changed

+64
-0
lines changed

Dockerfile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM bitnami/minideb:stretch
2+
LABEL maintainer="nopunkindented"
3+
4+
WORKDIR /tmp
5+
6+
RUN install_packages python3 \
7+
python3-pip \
8+
python3-setuptools \
9+
python3-dev \
10+
build-essential \
11+
supervisor
12+
13+
COPY requirements.txt /tmp/requirements.txt
14+
RUN pip3 install -U pip
15+
RUN pip3 install -r /tmp/requirements.txt
16+
17+
ADD api /dmsh/api/
18+
ADD supervisor /etc/supervisor/
19+
20+
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf", "--nodaemon"]

README.md

Whitespace-only changes.

api/api.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import hug
2+
3+
4+
@hug.cli()
5+
@hug.local()
6+
@hug.get()
7+
def ping():
8+
return 'pong'

requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
hug
2+
uwsgi

supervisor/conf.d/api.conf

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[program:api]
2+
directory=/dmsh/api/
3+
command=uwsgi --http 0.0.0.0:8080 --wsgi-file /dmsh/api/api.py --callable __hug_wsgi__
4+
autostart=true
5+
stdout_logfile=/var/log/api_stdout.log
6+
stderr_logfile=/var/log/api_stderr.log

supervisor/supervisord.conf

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
; supervisor config file
2+
3+
[unix_http_server]
4+
file=/var/run//supervisor.sock ; (the path to the socket file)
5+
chmod=0700 ; sockef file mode (default 0700)
6+
7+
[supervisord]
8+
logfile=/var/log/supervisord.log ; (main log file;default $CWD/supervisord.log)
9+
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
10+
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
11+
12+
; the below section must remain in the config file for RPC
13+
; (supervisorctl/web interface) to work, additional interfaces may be
14+
; added by defining them in separate rpcinterface: sections
15+
[rpcinterface:supervisor]
16+
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
17+
18+
[supervisorctl]
19+
serverurl=unix:///var/run//supervisor.sock ; use a unix:// URL for a unix socket
20+
21+
; The [include] section can just contain the "files" setting. This
22+
; setting can list multiple files (separated by whitespace or
23+
; newlines). It can also contain wildcards. The filenames are
24+
; interpreted as relative to this file. Included files *cannot*
25+
; include files themselves.
26+
27+
[include]
28+
files = /etc/supervisor/conf.d/*.conf

0 commit comments

Comments
 (0)