Skip to content

Commit b315d48

Browse files
Merge pull request #121 from autonomys/systemd
add systemd files for production process management
2 parents 97edaea + e74339a commit b315d48

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

systemd/logrotate

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/var/log/auto-drive-gateway.log {
2+
daily
3+
rotate 7
4+
compress
5+
missingok
6+
notifempty
7+
create 0644 ubuntu ubuntu
8+
su ubuntu ubuntu
9+
postrotate
10+
systemctl restart auto-drive-gateway.service > /dev/null 2>/dev/null || true
11+
endscript
12+
}

systemd/systemd

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[Unit]
2+
Description=Auto Drive Gateway Service
3+
After=network.target
4+
5+
[Service]
6+
User=ubuntu
7+
Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
8+
WorkingDirectory=/home/ubuntu/deploy
9+
ExecStart=/usr/bin/docker compose \
10+
--env-file /home/ubuntu/deploy/.env \
11+
-f /home/ubuntu/deploy/auto-files-gateway/docker/file-retriever/docker-compose.yml \
12+
-f /home/ubuntu/deploy/auto-files-gateway/docker/file-retriever/docker-compose.prod.yml \
13+
-f /home/ubuntu/deploy/auto-files-gateway/docker/object-mapping-indexer/docker-compose.yml \
14+
-f /home/ubuntu/deploy/auto-files-gateway/docker/object-mapping-indexer/docker-compose.prod.yml \
15+
up -d
16+
Restart=always
17+
RestartSec=5
18+
SyslogIdentifier=auto-drive-gateway
19+
StandardOutput=append:/var/log/auto-drive-gateway.log
20+
StandardError=append:/var/log/auto-drive-gateway.log
21+
22+
# Resource limits
23+
CPUQuota=90%
24+
MemoryMax=4G
25+
26+
[Install]
27+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)