Skip to content

Commit ecddde6

Browse files
docker autoheal
1 parent 96f3653 commit ecddde6

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

.github/workflows/deploy.yml

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

docker-compose.yml

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

0 commit comments

Comments
 (0)