I have a Django application running using the docker containers on my local system. I want to start the application on system reboot. So, I decided to write a systemd service file.
[Unit]
Description=docker_container service
[Service]
WorkingDirectory=/home/sree/Documents/code/solutions_new/solutions/
ExecStart=/usr/bin/docker /usr/bin/docker-compose -f docker-compose_dev.yml up
Restart=always
RestartSec=60
[Install]
WantedBy=multi.user.target
On my system, I usually run the Django app in a virtual environment.Am getting the below error when trying to start the service file
docker_container.service - docker_container service
Loaded: loaded (/etc/systemd/system/docker_container.service; enabled;
vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Sun 2021-
01-24 09:33:49 PST; 9s ago
Process: 21241 ExecStart=/usr/bin/docker /usr/bin/docker-compose -f
docker-compose_dev.yml up (code=exited, status=125)
Main PID: 21241 (code=exited, status=125)
question from:
https://stackoverflow.com/questions/65874015/systemd-service-file-for-running-django-app-using-docker 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…