AurelioAguirre commited on
Commit
1ce5c45
·
1 Parent(s): dd4ba61

Fixed Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -17
Dockerfile CHANGED
@@ -1,33 +1,26 @@
1
- # Start from NVIDIA CUDA base image
2
- FROM nvidia/cuda:12.1.0-runtime-ubuntu22.04
3
 
4
- # Set working directory
5
- WORKDIR /code
6
 
7
- # Install system dependencies
8
- RUN apt-get update && apt-get install -y \
9
- python3.12 \
10
- python3-pip \
11
- git \
12
- && rm -rf /var/lib/apt/lists/*
13
 
14
  # Copy requirements first to leverage Docker cache
15
  COPY requirements.txt .
16
 
17
- # Install Python dependencies
18
- RUN pip3 install --no-cache-dir -r requirements.txt
19
 
20
  # Copy the application code
21
  COPY ./app /code/app
22
  COPY ./utils /code/utils
23
 
24
  # Set environment variables
25
- ENV PYTHONPATH=/code
26
- ENV TRANSFORMERS_CACHE=/code/app/.cache
27
- ENV CUDA_VISIBLE_DEVICES=0
28
 
29
- # Expose the port the app runs on
30
- EXPOSE 8000
31
 
32
  # Command to run the application
33
  CMD ["python3", "-m", "app.main"]
 
 
 
1
 
2
+ # Use Python 3.12 slim image as base
3
+ FROM python:3.12-slim
4
 
5
+ # Set working directory
6
+ WORKDIR /app
 
 
 
 
7
 
8
  # Copy requirements first to leverage Docker cache
9
  COPY requirements.txt .
10
 
11
+ # Install dependencies
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
 
14
  # Copy the application code
15
  COPY ./app /code/app
16
  COPY ./utils /code/utils
17
 
18
  # Set environment variables
19
+ ENV PYTHONPATH=/app
20
+ ENV PYTHONUNBUFFERED=1
 
21
 
22
+ # Expose the port your application runs on (assuming 8002 from your config)
23
+ EXPOSE 7680
24
 
25
  # Command to run the application
26
  CMD ["python3", "-m", "app.main"]