-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (32 loc) · 979 Bytes
/
Dockerfile
File metadata and controls
39 lines (32 loc) · 979 Bytes
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
37
38
39
# Usa una imagen base de Python
FROM python:3.11-slim
# Configura variables de entorno
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
# Instala dependencias del sistema para pyzbar y bibliotecas necesarias para zbar
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libzbar0 \
libzbar-dev \
libgl1 \
libxrender1 \
libfontconfig1 \
libsm6 \
libxext6 \
libice6 \
libgtk2.0-dev \
zbar-tools \
freeglut3-dev \
&& rm -rf /var/lib/apt/lists/*
# Crea el directorio de trabajo y copia el archivo de requerimientos
WORKDIR /app
COPY requirements.txt .
# Instala las dependencias de Python
RUN pip install --no-cache-dir -r requirements.txt
# Copia el código fuente al contenedor
COPY . .
# Expone el puerto 8000 para FastAPI
EXPOSE 8000
# Comando para ejecutar la aplicación FastAPI
CMD ["gunicorn", "-w", "1", "-k", "uvicorn.workers.UvicornWorker", "main:app"]