amaye15 commited on
Commit
32d4248
·
1 Parent(s): 3ea8097

Debug - docker

Browse files
Files changed (1) hide show
  1. Dockerfile +1 -80
Dockerfile CHANGED
@@ -1,74 +1,3 @@
1
- # # Stage 1: Build stage
2
- # FROM python:3.11-slim as builder
3
-
4
- # # Set environment variables
5
- # ENV PYTHONDONTWRITEBYTECODE=1 \
6
- # PYTHONUNBUFFERED=1 \
7
- # PATH="/root/.local/bin:$PATH"
8
-
9
- # # Install system dependencies (curl and ca-certificates for uv installer)
10
- # RUN apt-get update && apt-get install -y --no-install-recommends \
11
- # curl \
12
- # ca-certificates \
13
- # && rm -rf /var/lib/apt/lists/*
14
-
15
- # # Install uv using the official installer
16
- # RUN curl -sSfL https://astral.sh/uv/install.sh | sh
17
-
18
- # # Verify uv is installed and available
19
- # RUN uv --version
20
-
21
- # # Create a non-root user
22
- # RUN useradd -m -u 1000 user
23
-
24
- # # Set the working directory
25
- # WORKDIR /app
26
-
27
- # # Create a virtual environment
28
- # RUN uv venv /opt/venv
29
-
30
- # # Update PATH to include the virtual environment's bin directory
31
- # ENV PATH="/opt/venv/bin:$PATH"
32
-
33
- # # Copy only the requirements file first to leverage Docker cache
34
- # COPY --chown=user ./requirements.txt /app/requirements.txt
35
-
36
- # # Install dependencies into the virtual environment using uv
37
- # RUN uv pip install --no-cache-dir -r requirements.txt
38
-
39
- # # Copy the rest of the application code
40
- # COPY --chown=user . /app
41
-
42
- # # Stage 2: Runtime stage
43
- # FROM python:3.11-slim
44
-
45
- # # Create a non-root user
46
- # RUN useradd -m -u 1000 user
47
- # USER user
48
-
49
- # # Set environment variables
50
- # ENV PATH="/opt/venv/bin:$PATH" \
51
- # PYTHONUNBUFFERED=1
52
-
53
- # # Set the working directory
54
- # WORKDIR /app
55
-
56
- # # Copy the virtual environment from the builder stage
57
- # COPY --from=builder --chown=user /opt/venv /opt/venv
58
-
59
- # # Copy only the necessary files from the builder stage
60
- # COPY --from=builder --chown=user /app /app
61
-
62
- # # Expose the port the app runs on
63
- # EXPOSE 7860
64
-
65
- # # Health check to ensure the application is running
66
- # HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
67
- # CMD curl -f http://localhost:7860/health || exit 1
68
-
69
- # # Command to run the application with hot reloading
70
- # CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]
71
-
72
  # Stage 1: Build stage
73
  FROM python:3.11-slim as builder
74
 
@@ -77,7 +6,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
77
  PYTHONUNBUFFERED=1 \
78
  PATH="/root/.local/bin:$PATH"
79
 
80
- # Install system dependencies (curl, ca-certificates, and libgomp)
81
  RUN apt-get update && apt-get install -y --no-install-recommends \
82
  curl \
83
  ca-certificates \
@@ -114,11 +43,6 @@ COPY --chown=user . /app
114
  # Stage 2: Runtime stage
115
  FROM python:3.11-slim
116
 
117
- # Install libgomp in the runtime stage
118
- RUN apt-get update && apt-get install -y --no-install-recommends \
119
- libgomp1 \
120
- && rm -rf /var/lib/apt/lists/*
121
-
122
  # Create a non-root user
123
  RUN useradd -m -u 1000 user
124
  USER user
@@ -136,9 +60,6 @@ COPY --from=builder --chown=user /opt/venv /opt/venv
136
  # Copy only the necessary files from the builder stage
137
  COPY --from=builder --chown=user /app /app
138
 
139
- # Debugging step: Verify installed packages
140
- RUN /opt/venv/bin/python -m pip list
141
-
142
  # Expose the port the app runs on
143
  EXPOSE 7860
144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # Stage 1: Build stage
2
  FROM python:3.11-slim as builder
3
 
 
6
  PYTHONUNBUFFERED=1 \
7
  PATH="/root/.local/bin:$PATH"
8
 
9
+ # Install system dependencies (curl and ca-certificates for uv installer)
10
  RUN apt-get update && apt-get install -y --no-install-recommends \
11
  curl \
12
  ca-certificates \
 
43
  # Stage 2: Runtime stage
44
  FROM python:3.11-slim
45
 
 
 
 
 
 
46
  # Create a non-root user
47
  RUN useradd -m -u 1000 user
48
  USER user
 
60
  # Copy only the necessary files from the builder stage
61
  COPY --from=builder --chown=user /app /app
62
 
 
 
 
63
  # Expose the port the app runs on
64
  EXPOSE 7860
65