This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
FROM python:3.9-slim
|
||||
|
||||
# Install required system dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
docker.io \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy requirements first to leverage Docker cache
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy the healthcheck script
|
||||
COPY healthcheck.py .
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV BASE_URL="https://puppeteer.workwithkora.com"
|
||||
ENV TEST_URL="https://www.google.com"
|
||||
ENV API_KEY="Q7Sd#hhFkyHy*T"
|
||||
ENV TARGET_CONTAINER="puppeteer-api"
|
||||
ENV CHECK_INTERVAL=60
|
||||
|
||||
# Create a non-root user
|
||||
RUN useradd -m healthcheck && chown -R healthcheck:healthcheck /app
|
||||
|
||||
USER healthcheck
|
||||
|
||||
# Run the healthcheck script
|
||||
CMD ["python", "healthcheck.py"]
|
||||
Reference in New Issue
Block a user