diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e39bc83 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.git +.gitignore +.gitea +README.md +.dockerignore +*.md diff --git a/.gitea/workflows/build-push.yml b/.gitea/workflows/build-push.yml index 813827f..df62cb5 100644 --- a/.gitea/workflows/build-push.yml +++ b/.gitea/workflows/build-push.yml @@ -27,6 +27,8 @@ jobs: uses: docker/metadata-action@v5 with: images: gitea.reeseapps.com/services/alicia-ai-terminology + tags: | + type=raw,value=main,enable=${{ github.ref == 'refs/heads/main' }} - name: Build and push uses: docker/build-push-action@v6 diff --git a/README.md b/README.md index c1207d8..1841803 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,33 @@ python3 -m http.server 8080 Then open `http://localhost:8080`. -## Podman +## Podman (Quadlet) -Build and run with Podman: +Run with Podman quadlets for systemd integration: + +```bash +mkdir -p ~/.config/containers/systemd +cp alicia_demo.container ~/.config/containers/systemd/ +systemctl --user daemon-reload +systemctl --user start alicia_demo.service +``` + +Then open `http://localhost:8080`. + +Stop and remove: + +```bash +systemctl --user stop alicia_demo.service +systemctl --user disable alicia_demo.service +rm ~/.config/containers/systemd/alicia_demo.container +systemctl --user daemon-reload +``` + +Build and run directly: ```bash podman build -t alicia-ai-cheatsheet . -podman run -d --name alicai-ai-cheatsheet -p 9090:80 alicia-ai-cheatsheet +podman run -d --name alicia-ai-cheatsheet -p 9090:8080 alicia-ai-cheatsheet ``` Then open `http://localhost:9090`. @@ -38,8 +58,8 @@ Then open `http://localhost:9090`. Stop and remove: ```bash -podman stop alicai-ai-cheatsheet -podman rm alicai-ai-cheatsheet +podman stop alicia-ai-cheatsheet +podman rm alicia-ai-cheatsheet ``` ## Structure diff --git a/alicia_demo.container b/alicia_demo.container new file mode 100644 index 0000000..27b61b7 --- /dev/null +++ b/alicia_demo.container @@ -0,0 +1,18 @@ +[Container] +ContainerName=alicia_demo +PublishPort=8080:8080/tcp +Image=gitea.reeseapps.com/services/alicia-ai-terminology:main +HealthCheckInterval=30s +HealthCheckTimeout=10s +HealthCheckRetries=5 +HealthCheckCommand=WGET --spider --quiet http://localhost:8080 + +[Unit] +Description=Alicia Demo Web Service + +[Service] +TimeoutStartSec=0 +Restart=on-failure + +[Install] +WantedBy=default.target