Skip to content

Commit 27ded3e

Browse files
committed
Adding DevOps with Harness
1 parent 84f9203 commit 27ded3e

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

docker-compose.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Deployed with Harness by Gabs with Templates
2+
version: "3.9"
3+
4+
services:
5+
langcache-demo:
6+
container_name: langcache-demo
7+
image: <+pipeline.stages.Deploy_to_GCE.spec.artifacts.primary.imagePath>:<+pipeline.stages.Deploy_to_GCE.spec.artifacts.primary.tag>
8+
# platform: linux/amd64 # uncomment if on Apple Silicon host forcing amd64
9+
ports:
10+
- "7860:7860"
11+
env_file:
12+
- .env
13+
restart: unless-stopped
14+
15+
# Healthcheck: adjust the URL if your app has a specific health endpoint.
16+
# Fallback TCP check example is below if HTTP isn’t available.
17+
healthcheck:
18+
test: ["CMD-SHELL", "curl -fsS http://localhost:7860/ || exit 1"]
19+
interval: 20s
20+
timeout: 3s
21+
retries: 5
22+
start_period: 30s
23+
24+
# (optional) tighten logs a bit
25+
logging:
26+
driver: "json-file"
27+
options:
28+
max-size: "10m"
29+
max-file: "3"

langcache-demo.service

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[Unit]
2+
Description=langcache demo (docker compose)
3+
Requires=docker.service
4+
After=docker.service network-online.target
5+
Wants=network-online.target
6+
7+
[Service]
8+
Type=oneshot
9+
WorkingDirectory=/root
10+
ExecStart=/usr/bin/docker compose up -d --remove-orphans
11+
ExecStop=/usr/bin/docker compose down
12+
RemainAfterExit=yes
13+
# If compose ever fails (e.g., transient Docker error), retry:
14+
Restart=on-failure
15+
RestartSec=10s
16+
17+
[Install]
18+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)