chartManD commited on
Commit
c66d00f
·
1 Parent(s): a61d1bc

Config Dockerfile, creacion de un entorno virtual

Browse files
Files changed (1) hide show
  1. Dockerfile +59 -23
Dockerfile CHANGED
@@ -1,50 +1,86 @@
1
- FROM debian:12.10
2
 
3
- RUN apt -y update
4
- RUN apt install -y python3 python3-pip python3-mysqldb
5
-
6
- RUN PIP_BREAK_SYSTEM_PACKAGES=1
 
7
 
8
  WORKDIR /app
9
 
10
- COPY . .
 
 
 
 
 
11
 
12
- RUN pip install -r ./requirements.txt
 
13
 
14
- RUN python3 manage.py migrate
 
 
 
 
15
 
16
  RUN python manege.py shell < create_superuser.py
17
 
 
 
18
  CMD ["python3", "manage.py", "runserver", "0.0.0.0:7860"]
19
- # CMD ["gunicorn", "cata_system.wsgi:tecnicas", "--bind", "0.0.0.0:7860"]
20
-
21
- # python3 manage.py runserver 0:7860; \
22
 
23
  # FROM python:3.11-slim
24
 
25
- # WORKDIR /app
 
 
 
 
 
26
 
27
- # RUN ls
 
28
 
 
29
  # COPY requirements.txt .
30
 
31
- # RUN pip install -r --upgrade pip
32
-
33
- # RUN ls
34
 
35
- # RUN pip install -r requirements.txt
 
 
36
 
 
37
  # COPY . .
38
 
39
- # RUN python manege.py migrate
 
40
 
41
- # RUN python manage.py tailwind build
 
42
 
43
- # RUN python manage.py collectstatic --noinput
44
 
45
- # RUN python manege.py shell < create_superuser.py
 
46
 
47
- # EXPOSE 7860
 
 
48
 
49
- # # Comando de inicio (usar gunicorn en vez de runserver en producción)
 
 
 
 
 
 
 
 
50
  # CMD ["gunicorn", "cata_system.wsgi:tecnicas", "--bind", "0.0.0.0:7860"]
 
 
1
+ FROM python:3.11-slim
2
 
3
+ RUN apt-get update && apt-get install -y \
4
+ build-essential \
5
+ libpq-dev \
6
+ python3-dev \
7
+ && rm -rf /var/lib/apt/lists/*
8
 
9
  WORKDIR /app
10
 
11
+ COPY requirements.txt .
12
+
13
+ RUN python -m venv /opt/venv
14
+ ENV PATH="/opt/venv/bin:$PATH"
15
+
16
+ RUN ls
17
 
18
+ RUN python -m venv /opt/venv
19
+ ENV PATH="/opt/venv/bin:$PATH"
20
 
21
+ COPY . .
22
+
23
+ RUN python manege.py migrate
24
+ # RUN python manage.py tailwind build
25
+ # RUN python manage.py collectstatic --noinput
26
 
27
  RUN python manege.py shell < create_superuser.py
28
 
29
+ EXPOSE 7860
30
+
31
  CMD ["python3", "manage.py", "runserver", "0.0.0.0:7860"]
32
+
33
+ #########
 
34
 
35
  # FROM python:3.11-slim
36
 
37
+ # # Instalar dependencias del sistema
38
+ # RUN apt-get update && apt-get install -y \
39
+ # build-essential \
40
+ # libpq-dev \
41
+ # python3-dev \
42
+ # && rm -rf /var/lib/apt/lists/*
43
 
44
+ # # Establecer directorio de trabajo
45
+ # WORKDIR /app
46
 
47
+ # # Copiar requirements primero para cachear dependencias
48
  # COPY requirements.txt .
49
 
50
+ # # Crear y activar entorno virtual
51
+ # RUN python -m venv /opt/venv
52
+ # ENV PATH="/opt/venv/bin:$PATH"
53
 
54
+ # # Instalar dependencias de Python
55
+ # RUN pip install --upgrade pip && \
56
+ # pip install -r requirements.txt
57
 
58
+ # # Copiar el resto de la aplicación
59
  # COPY . .
60
 
61
+ # # Exponer puerto
62
+ # EXPOSE 7860
63
 
64
+ # # Comando para ejecutar la aplicación
65
+ # CMD ["python", "manage.py", "runserver", "0.0.0.0:7860"]
66
 
67
+ # FROM debian:12.10
68
 
69
+ # RUN apt -y update
70
+ # RUN apt install -y python3 python3-pip python3-mysqldb
71
 
72
+ # RUN PIP_BREAK_SYSTEM_PACKAGES=1
73
+
74
+ # WORKDIR /app
75
 
76
+ # COPY . .
77
+
78
+ # RUN pip install -r ./requirements.txt
79
+
80
+ # RUN python3 manage.py migrate
81
+
82
+ # RUN python manege.py shell < create_superuser.py
83
+
84
+ # CMD ["python3", "manage.py", "runserver", "0.0.0.0:7860"]
85
  # CMD ["gunicorn", "cata_system.wsgi:tecnicas", "--bind", "0.0.0.0:7860"]
86
+