healthchecks

This commit is contained in:
Lewis Crichton
2023-05-24 10:14:04 +01:00
parent b0e6360e2f
commit 4fabb38dd9
2 changed files with 12 additions and 2 deletions
+3 -1
View File
@@ -10,7 +10,9 @@ RUN go build -o backend
FROM alpine:latest FROM alpine:latest
RUN apk --no-cache add ca-certificates RUN apk --no-cache add ca-certificates curl
COPY --from=builder /app/backend /backend COPY --from=builder /app/backend /backend
HEALTHCHECK --interval=15s --timeout=3s CMD curl -f http://localhost:8080/v1/ || exit 1
CMD ["/backend"] CMD ["/backend"]
+9 -1
View File
@@ -7,6 +7,13 @@ services:
restart: always restart: always
volumes: volumes:
- ./redis-data:/data - ./redis-data:/data
environment:
REDIS_ARGS: --save 300 1 60 10
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
backend: backend:
image: vencord/backend image: vencord/backend
@@ -15,4 +22,5 @@ services:
env_file: env_file:
- .env - .env
depends_on: depends_on:
- redis redis:
condition: service_healthy