valencar commited on
Commit
3315573
·
verified ·
1 Parent(s): 1839828

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -44
Dockerfile CHANGED
@@ -1,44 +1,25 @@
1
- # Use uma imagem base adequada
2
- FROM python:3.9-slim
3
-
4
- # Defina o diretório de trabalho
5
- WORKDIR /app
6
-
7
- # Copie o arquivo ZIP para dentro do contêiner
8
- COPY random_xrays.zip /app/
9
-
10
- # Instale dependências (se necessário)
11
- RUN apt-get update && apt-get install -y unzip
12
-
13
- # Liste os arquivos para depuração (opcional)
14
- RUN ls -l
15
-
16
- # Descompacte o arquivo ZIP
17
- RUN unzip /app/random_xrays.zip -d /app/random_xrays
18
-
19
-
20
- # Copy the requirements file and install dependencies
21
- COPY requirements.txt .
22
-
23
- # RUN pip install -r requirements.txt
24
-
25
- RUN pip install --no-cache-dir -r requirements.txt
26
-
27
- # Instala Gunicorn
28
- RUN pip install gunicorn
29
-
30
-
31
- # Copy your Flask application files
32
- COPY . .
33
-
34
- # Expõe porta
35
- EXPOSE 8000
36
-
37
- # Comando de produção com Gunicorn
38
- CMD ["gunicorn", "-b", "0.0.0.0:8000", "app:app"]
39
-
40
- # # Expose the port your Flask app will run on (default is 5000)
41
- # EXPOSE 5000
42
-
43
- # # Command to run your Flask application
44
- # CMD ["flask", "run", "--host=0.0.0.0", "--port=5000"]
 
1
+ FROM python:3.9-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Instalar unzip
6
+ RUN apt-get update && apt-get install -y unzip
7
+
8
+ # Copiar ZIP e descompactar diretamente na pasta correta
9
+ COPY random_xrays.zip .
10
+ RUN unzip random_xrays.zip && rm random_xrays.zip
11
+
12
+ # Copiar requirements
13
+ COPY requirements.txt .
14
+ RUN pip install --no-cache-dir -r requirements.txt
15
+
16
+ # Instalar Gunicorn
17
+ RUN pip install gunicorn
18
+
19
+ # Copiar restante código
20
+ COPY . .
21
+
22
+ # Expor porta usada pelo Hugging Face (7860)
23
+ EXPOSE 7860
24
+
25
+ CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]