-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchrontainer.service
More file actions
48 lines (39 loc) · 1.03 KB
/
chrontainer.service
File metadata and controls
48 lines (39 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Systemd service file for Chrontainer
# Copy this file to /etc/systemd/system/chrontainer.service
# Then run: sudo systemctl daemon-reload && sudo systemctl enable chrontainer && sudo systemctl start chrontainer
[Unit]
Description=Chrontainer - Docker Container Scheduler
After=network.target docker.service
Requires=docker.service
[Service]
Type=notify
User=root
Group=root
WorkingDirectory=/opt/chrontainer
Environment="PATH=/usr/local/bin:/usr/bin:/bin"
EnvironmentFile=-/opt/chrontainer/.env
# Create data directory
ExecStartPre=/bin/mkdir -p /data
# Start Gunicorn
ExecStart=/usr/local/bin/gunicorn -c /opt/chrontainer/gunicorn.conf.py wsgi:application
# Restart policy
Restart=always
RestartSec=10
KillMode=mixed
KillSignal=SIGTERM
TimeoutStopSec=30
# Security hardening
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/data
# Resource limits
LimitNOFILE=65535
LimitNPROC=4096
# Logging
StandardOutput=journal
StandardError=journal
SyslogIdentifier=chrontainer
[Install]
WantedBy=multi-user.target