aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2019-09-13 23:25:19 -0400
committerMitch Riedstra <mitch@riedstra.us>2019-09-13 23:25:19 -0400
commit103d362b6a76f1bc05b038e7e0b68eb5cd37dc26 (patch)
treeac52f33767edc25c31ea9f7e71296a1e27c7eb1b /etc
parentd16ac1fa8e8b7019156ae11267a23d957aed6495 (diff)
downloaddispatch-tracker-103d362b6a76f1bc05b038e7e0b68eb5cd37dc26.tar.gz
dispatch-tracker-103d362b6a76f1bc05b038e7e0b68eb5cd37dc26.tar.xz
failed experiment with running the demo application entirely inside of a docker containerdemo
Diffstat (limited to 'etc')
-rw-r--r--etc/nginx/nginx.conf44
-rw-r--r--etc/profile.d/runit.sh1
-rwxr-xr-xetc/start3
-rwxr-xr-xetc/sv/nginx/run3
-rwxr-xr-xetc/sv/postgres/run14
-rw-r--r--etc/sv/uwsgi/run9
6 files changed, 74 insertions, 0 deletions
diff --git a/etc/nginx/nginx.conf b/etc/nginx/nginx.conf
new file mode 100644
index 0000000..1235f67
--- /dev/null
+++ b/etc/nginx/nginx.conf
@@ -0,0 +1,44 @@
+worker_processes 1;
+
+events {
+ worker_connections 1024;
+}
+
+http {
+ include mime.types;
+ default_type application/octet-stream;
+
+ sendfile on;
+ #tcp_nopush on;
+
+ #keepalive_timeout 0;
+ keepalive_timeout 65;
+
+ gzip on;
+
+ server_tokens off;
+
+ server {
+ listen 80;
+ listen [::]:80;
+ server_name localhost;
+
+ location / {
+ include uwsgi_params;
+ client_max_body_size 20m;
+ client_body_timeout 300s;
+ uwsgi_pass 127.0.0.1:9200;
+ }
+
+ location /static {
+ alias /static;
+ }
+ location /robots.txt {
+ alias /static/robots.txt;
+ }
+
+ }
+
+ include conf.d/*.conf;
+
+}
diff --git a/etc/profile.d/runit.sh b/etc/profile.d/runit.sh
new file mode 100644
index 0000000..c114c7e
--- /dev/null
+++ b/etc/profile.d/runit.sh
@@ -0,0 +1 @@
+export SVDIR=/etc/sv
diff --git a/etc/start b/etc/start
new file mode 100755
index 0000000..808ee81
--- /dev/null
+++ b/etc/start
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec runsvdir -P /etc/sv "log: ...................................................................................."
diff --git a/etc/sv/nginx/run b/etc/sv/nginx/run
new file mode 100755
index 0000000..edc430d
--- /dev/null
+++ b/etc/sv/nginx/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+mkdir -p /run/nginx
+exec nginx -g 'daemon off;'
diff --git a/etc/sv/postgres/run b/etc/sv/postgres/run
new file mode 100755
index 0000000..dafcfe3
--- /dev/null
+++ b/etc/sv/postgres/run
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -e
+pguser="postgres"
+
+PGDATA="/postgres"
+if ! [ -d "$PGDATA" ] ; then
+ mkdir -p "$PGDATA"
+ chown -R "$pguser" "$PGDATA"
+ chmod 700 "$PGDATA"
+ su - postgres -m -c "pg_ctl initdb -D \"$PGDATA\""
+fi
+
+mkdir -p /run/postgresql && chown "$pguser" /run/postgresql
+exec chpst -u postgres:postgres postgres -D "$PGDATA" 2>&1
diff --git a/etc/sv/uwsgi/run b/etc/sv/uwsgi/run
new file mode 100644
index 0000000..a5762d8
--- /dev/null
+++ b/etc/sv/uwsgi/run
@@ -0,0 +1,9 @@
+#!/bin/sh
+set -e
+set -x
+sv check postgres 2>&1 >/dev/null || exit 1
+if ! [ -e /setup ] ; then
+ su -l app -c "/bin/sh /app/setup.sh"
+ touch /setup
+fi
+uwsgi --ini /app/uwsgi.ini