diff --git a/service/ctf-platform.service b/service/ctf-platform.service new file mode 100644 index 0000000..7187104 --- /dev/null +++ b/service/ctf-platform.service @@ -0,0 +1,18 @@ +[Unit] +Description=IceCTF platform +Requires=ctf-platform.socket +After=network.target + +[Service] +PIDFile=/srv/run/ctf-platform/pid +User=deploy +Group=deploy +WorkingDirectory=/srv/ctf-platform/ +ExecStart=/usr/local/bin/gunicorn --pid /srv/run/ctf-platform/pid app:app +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s TERM $MAINPID +PrivateTmp=true +Environment=PRODUCTION=true + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/service/ctf-platform.socket b/service/ctf-platform.socket new file mode 100644 index 0000000..88deb92 --- /dev/null +++ b/service/ctf-platform.socket @@ -0,0 +1,9 @@ +[Unit] +Description=IceCTF platform socket + +[Socket] +ListenStream=/srv/run/ctf-platform/socket +ListenStream=0.0.0.0:9002 + +[Install] +WantedBy=sockets.target \ No newline at end of file