forked from frlp-utn-ingsoft/vetsoft
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from GonzaloEBaez/bugfix/deploy-continuo
Bugfix/deploy continuo
- Loading branch information
Showing
3 changed files
with
44 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,27 @@ | ||
# Ignorar archivos y directorios generados durante el desarrollo | ||
*.pyc | ||
__pycache__ | ||
# Ignorar archivos de configuración local | ||
# Archivos sensibles | ||
.env | ||
config/local_config.py | ||
# Ignorar archivos de git | ||
*.key | ||
*.pem | ||
|
||
# Archivos de control de versiones | ||
.git | ||
.gitignore | ||
# Ignorar archivos Logs o Temporales | ||
logs/ | ||
tmp/ | ||
.hg | ||
|
||
# Archivos temporales y de compilación | ||
_pycache_ | ||
*.pyc | ||
*.pyo | ||
*.log | ||
|
||
# Copias de seguridad y archivos temporales de editores | ||
*.bak | ||
*.swp | ||
|
||
# Documentación y otros archivos no necesarios | ||
README.md | ||
docs/ | ||
|
||
# Archivos de desarrollo local | ||
.vscode/ | ||
.idea/ | ||
tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
# Utilizamos una imagen base adecuada para nuestra aplicación. En este caso, usaremos una imagen de Python. | ||
FROM python:3.10-slim | ||
FROM python:3.11-slim as builder | ||
|
||
# Establecemos el directorio de trabajo dentro del contenedor | ||
WORKDIR /app | ||
|
||
# Copiamos el archivo de requerimientos de Python | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
COPY requirements.txt . | ||
|
||
# Instalamos las dependencias de la aplicación | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
RUN pip wheel --no-cache-dir --no-deps --wheel-dir /app/wheels -r requirements.txt | ||
|
||
FROM python:3.11-slim | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/wheels /wheels | ||
COPY --from=builder /app/requirements.txt . | ||
|
||
RUN pip install --no-cache /wheels/* | ||
|
||
# Copiamos el código fuente de la aplicación al contenedor | ||
COPY . . | ||
|
||
# Aplicamos migraciones | ||
RUN python manage.py migrate | ||
RUN ["python", "manage.py", "migrate"] | ||
|
||
# Exponemos el puerto en el que se ejecuta la aplicación | ||
EXPOSE 8000 | ||
|
||
# Comando para ejecutar la aplicación | ||
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] | ||
CMD ["gunicorn", "--bind", ":8000", "--workers", "2", "vetsoft.wsgi"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters