Skip to content

Commit ded017c

Browse files
docker compose
1 parent e00d307 commit ded017c

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

.github/workflows/deploy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
username: ${{ secrets.SSH_USER }}
2929
key: ${{ secrets.SSH_KEY }}
3030
script: |
31-
docker pull swiftfiddle/swiftfiddle-runner:latest
32-
docker rename swiftfiddle-runner swiftfiddle-runner_
33-
docker stop swiftfiddle-runner_
34-
docker run -d --rm -p 80:8000 --name swiftfiddle-runner swiftfiddle/swiftfiddle-runner
35-
docker image prune -f
31+
cd swiftfiddle-runner
32+
git pull --rebase origin main
33+
34+
docker compose up --force-recreate --build --detach
35+
docker image prune --force

docker-compose.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
services:
2+
web:
3+
image: swiftfiddle/swiftfiddle-runner:latest
4+
container_name: swiftfiddle-runner
5+
ports:
6+
- 80:8000
7+
healthcheck:
8+
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
9+
interval: 5m
10+
timeout: 30s
11+
retries: 3
12+
start_period: 40s
13+
autoheal:
14+
image: willfarrell/autoheal:latest
15+
container_name: autoheal
16+
environment:
17+
AUTOHEAL_INTERVAL: 60
18+
AUTOHEAL_START_PERIOD: 60
19+
restart: always
20+
volumes:
21+
- /var/run/docker.sock:/var/run/docker.sock

0 commit comments

Comments
 (0)