diff --git a/Dockerfile b/Dockerfile
index 55aba11..ac02366 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -21,6 +21,8 @@ COPY . /opt/services/djangoapp/src
RUN poetry install --no-dev
COPY resources/s6-rc.d /etc/s6-overlay/s6-rc.d
+COPY resources/run /opt/services/djangoapp/run
+
ARG S6_VERSION=3.1.0.1
ARG S6_URL=https://github.com/just-containers/s6-overlay/releases/download
RUN arch="$(dpkg --print-architecture)"; \
@@ -36,3 +38,4 @@ EXPOSE 8000
ENTRYPOINT ["/init"]
# TODO: change to an app user?
+CMD ["/command/with-contenv", "../run"]
diff --git a/docker-compose.yml b/docker-compose.yml
index 27fcfa3..dbf06ff 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -9,6 +9,7 @@ services:
- .env
environment:
DOCKER_ENV: 'on'
+ S6_KILL_GRACETIME: 1
volumes:
- requirements_volume:/opt/services/djangoapp/requirements
- static_volume:/opt/services/djangoapp/static
diff --git a/resources/s6-rc.d/djangoapp/run b/resources/run
similarity index 100%
rename from resources/s6-rc.d/djangoapp/run
rename to resources/run
diff --git a/resources/s6-rc.d/djangoapp/dependencies.d/redis b/resources/s6-rc.d/djangoapp/dependencies.d/redis
deleted file mode 100644
index e69de29..0000000
diff --git a/resources/s6-rc.d/djangoapp/dependencies.d/setup3 b/resources/s6-rc.d/djangoapp/dependencies.d/setup3
deleted file mode 100644
index e69de29..0000000
diff --git a/resources/s6-rc.d/djangoapp/finish b/resources/s6-rc.d/djangoapp/finish
deleted file mode 100644
index 54007bd..0000000
--- a/resources/s6-rc.d/djangoapp/finish
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/command/execlineb -S2
-
-s6-svscanctl -t /run/service
diff --git a/resources/s6-rc.d/djangoapp/type b/resources/s6-rc.d/djangoapp/type
deleted file mode 100644
index 5883cff..0000000
--- a/resources/s6-rc.d/djangoapp/type
+++ /dev/null
@@ -1 +0,0 @@
-longrun
diff --git a/resources/s6-rc.d/setup1/up b/resources/s6-rc.d/setup1/up
old mode 100755
new mode 100644
index e56cfdf..691ec95
--- a/resources/s6-rc.d/setup1/up
+++ b/resources/s6-rc.d/setup1/up
@@ -1,4 +1,4 @@
-#!/command/execlineb -P
+# execline
cd /opt/services/djangoapp/requirements
foreground { touch requirements.txt }
diff --git a/resources/s6-rc.d/setup2/up b/resources/s6-rc.d/setup2/up
old mode 100755
new mode 100644
index b4e8296..44066a2
--- a/resources/s6-rc.d/setup2/up
+++ b/resources/s6-rc.d/setup2/up
@@ -1,4 +1,4 @@
-#!/command/execlineb -P
+# execline
cd /opt/services/djangoapp/src
with-contenv
diff --git a/resources/s6-rc.d/setup3/up b/resources/s6-rc.d/setup3/up
old mode 100755
new mode 100644
index 3a5de1a..2cb26ce
--- a/resources/s6-rc.d/setup3/up
+++ b/resources/s6-rc.d/setup3/up
@@ -1,6 +1,10 @@
-#!/command/execlineb -P
+# execline
cd /opt/services/djangoapp/src
-# if { test -n $AUTO_MIGRATE } i don't know how
with-contenv
+if -t
+{
+ importas -D "" AUTO_MIGRATE AUTO_MIGRATE
+ test -n ${AUTO_MIGRATE}
+}
python3 manage.py migrate --noinput
diff --git a/resources/s6-rc.d/user/contents.d/djangoapp b/resources/s6-rc.d/user/contents.d/djangoapp
deleted file mode 100644
index e69de29..0000000
diff --git a/templates/admin/formative/formblock/change_form.html b/templates/admin/formative/formblock/change_form.html
index 7a1a43c..e289227 100644
--- a/templates/admin/formative/formblock/change_form.html
+++ b/templates/admin/formative/formblock/change_form.html
@@ -25,7 +25,7 @@
{% else %}
{% if form_id %}
- {% else %}
+ {% elif original.form %}
{% endif %}
{% endif %}