feat: unhealthy status, closes #43

Highlight an unhealthy container in Orange, and display "! running" as the state,

refactor: Move dev Docker files to docker directory
This commit is contained in:
Jack Wills
2024-08-01 14:46:58 +00:00
parent f408acfe9a
commit de87681816
11 changed files with 291 additions and 80 deletions
+17
View File
@@ -0,0 +1,17 @@
# Use an official lightweight image as a base
FROM alpine:latest
# Install a simple utility (e.g., curl) to run as a health check
RUN apk --no-cache add curl
# Create a dummy file that we will use in our health check
RUN touch /tmp/healthy
# Define a simple health check
HEALTHCHECK --interval=5s --timeout=3s --retries=3 \
CMD [ ! -f /tmp/healthy ] || exit 1
# Start a basic loop that keeps the container running
CMD ["sh", "-c", "while :; do echo 'Container is running but will be unhealthy'; sleep 30; done"]
# docker build -t unhealthy-container . -f Dockerfile.unhealthy; docker run -d --name unhealthy unhealthy-container
+58
View File
@@ -0,0 +1,58 @@
networks:
oxker-example-net:
name: oxker-examaple-net
services:
postgres:
image: postgres:alpine3.20
container_name: postgres
environment:
- POSTGRES_PASSWORD=never_use_this_password_in_production
ipc: private
restart: always
shm_size: 256MB
networks:
- oxker-example-net
deploy:
resources:
limits:
memory: 1024M
redis:
image: redis:alpine3.20
container_name: redis
ipc: private
restart: always
networks:
- oxker-example-net
deploy:
resources:
limits:
memory: 384M
rabbitmq:
image: rabbitmq:3
container_name: rabbitmq
ipc: private
restart: always
networks:
- oxker-example-net
deploy:
resources:
limits:
memory: 512M
some_container:
container_name: some_container
image: some_container
build:
context: .
dockerfile: Dockerfile.unhealthy
ipc: private
restart: always
networks:
- oxker-example-net
deploy:
resources:
limits:
memory: 128M