diff --git a/etc/systemd/system/docker-compose-website.service b/etc/systemd/system/docker-compose-website.service new file mode 100644 index 0000000..3501b4b --- /dev/null +++ b/etc/systemd/system/docker-compose-website.service @@ -0,0 +1,17 @@ +[Unit] +Description=Docker Compose Website Application Service +Requires=docker.service +After=docker.service + +[Service] +WorkingDirectory=/opt/website +ExecStart=/usr/bin/docker-compose --project-name website up +ExecStop=/usr/bin/docker-compose --project-name website down +TimeoutStartSec=0 +Restart=on-failure +StartLimitIntervalSec=60 +StartLimitBurst=3 + +[Install] +WantedBy=multi-user.target + diff --git a/opt/website/docker-compose.yml b/opt/website/docker-compose.yml new file mode 100644 index 0000000..bdfaba2 --- /dev/null +++ b/opt/website/docker-compose.yml @@ -0,0 +1,9 @@ +version: "3.8" + +services: + website: + container_name: website + image: jilits/website:0.1.0 + restart: unless-stopped + ports: + - 8000:1313