From 3705029f12e2d358474cde557de53ba621746b7b Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Thu, 19 Mar 2026 16:23:23 -0400 Subject: [PATCH] [systemd] Add a dc up step if a compose file exists --- systemd/.config/systemd/user/django@.service | 1 + 1 file changed, 1 insertion(+) diff --git a/systemd/.config/systemd/user/django@.service b/systemd/.config/systemd/user/django@.service index 370d326..67bba0c 100644 --- a/systemd/.config/systemd/user/django@.service +++ b/systemd/.config/systemd/user/django@.service @@ -7,6 +7,7 @@ Wants=network-online.target Type=simple Environment=PATH=%h/.local/bin:/home/linuxbrew/.linuxbrew/bin:/usr/local/bin:/usr/bin:/bin EnvironmentFile=%h/.local/etc/django/%i.env +ExecStartPre=/bin/bash -lc 'cd "$DJANGO_PATH" && if [ -f docker-compose.yml ]; then docker-compose up -d; fi' ExecStart=/bin/bash -c 'cd "$DJANGO_PATH" && if [ -f "$DJANGO_PATH/pyproject.toml" ]; then exec poetry run python manage.py runserver 0.0.0.0:${DJANGO_PORT:-8000}; else exec direnv exec "$DJANGO_PATH" python manage.py runserver 0.0.0.0:${DJANGO_PORT:-8000}; fi' Restart=on-failure RestartSec=2