File size: 774 Bytes
fab8051
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Use a base image with Python
FROM python:3.11-slim

# Set the working directory
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends git procps libmagic1 curl \
    && rm -rf /var/lib/apt/lists/*

# Copy the project configuration
COPY pyproject.toml /app/

# Environment variables
ENV HOME=/tmp
ENV APP_MODULE=app:app

# Install dependencies
RUN pip install --no-cache-dir -e .

# Copy all application files
COPY . /app/

# Expose the ports
EXPOSE 7870

# Health check endpoint
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
    CMD curl -f http://localhost:7870/cache/stats || exit 1

# Copy and use the startup script
COPY start.sh /app/
RUN chmod +x /app/start.sh

CMD ["/app/start.sh"]