-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (24 loc) · 880 Bytes
/
Dockerfile
File metadata and controls
33 lines (24 loc) · 880 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
# Utiliza una imagen oficial de Python
FROM python:3.10-slim
# Establece el directorio de trabajo
WORKDIR /code
# Instala dependencias del sistema
RUN apt-get update && \
apt-get install -y build-essential libpq-dev netcat-openbsd && \
rm -rf /var/lib/apt/lists/*
# Copia los archivos de dependencias
COPY requirements.txt ./
# Instala las dependencias de Python
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copia el resto del código de la app
COPY . .
# Copia y configura el script de inicialización
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Expone el puerto de la app
EXPOSE 8000
# Configura el entrypoint
ENTRYPOINT ["docker-entrypoint.sh"]
# Comando por defecto (puede ser sobreescrito por docker-compose)
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]