Factor Studios commited on
Commit
9a6b1a7
·
verified ·
1 Parent(s): c2049e5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -7
Dockerfile CHANGED
@@ -4,11 +4,12 @@ FROM python:3.11-slim
4
  # Set working directory
5
  WORKDIR /app
6
 
7
- # Install system dependencies
8
  RUN apt-get update && apt-get install -y \
9
  gcc \
10
  g++ \
11
  make \
 
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
  # Copy requirements first for better caching
@@ -23,21 +24,23 @@ COPY virtual_gpu/ ./virtual_gpu/
23
  # Copy the application source code
24
  COPY src/ ./src/
25
 
 
 
 
26
  # Create necessary directories
27
- RUN mkdir -p /app/src/static /app/src/templates
28
 
29
  # Set environment variables
30
  ENV PYTHONPATH=/app
31
- ENV FLASK_APP=src.main
32
  ENV FLASK_ENV=production
 
33
 
34
  # Expose port 5000
35
  EXPOSE 5000
36
 
37
- # Health check
38
  HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
39
- CMD curl -f http://localhost:5000/api/gpu-status || exit 1
40
 
41
  # Run the application
42
- CMD ["python", "src/main.py"]
43
-
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
+ # Install system dependencies including wget for health check
8
  RUN apt-get update && apt-get install -y \
9
  gcc \
10
  g++ \
11
  make \
12
+ wget \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
  # Copy requirements first for better caching
 
24
  # Copy the application source code
25
  COPY src/ ./src/
26
 
27
+ # Copy the main application file
28
+ COPY main.py .
29
+
30
  # Create necessary directories
31
+ RUN mkdir -p /app/static /app/database /app/src/static /app/src/templates
32
 
33
  # Set environment variables
34
  ENV PYTHONPATH=/app
 
35
  ENV FLASK_ENV=production
36
+ ENV PORT=5000
37
 
38
  # Expose port 5000
39
  EXPOSE 5000
40
 
41
+ # Health check using wget instead of curl
42
  HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
43
+ CMD wget --no-verbose --tries=1 --spider http://localhost:5000/health || exit 1
44
 
45
  # Run the application
46
+ CMD ["python", "main.py"]