Browse Source

Retoques para ver si funcionan los static

Celestino Rey 1 year ago
parent
commit
8027742f7c
4 changed files with 5 additions and 67 deletions
  1. 0 62
      Dockerfile.k8s
  2. 1 1
      Makefile
  3. 3 3
      src/config/entrypoint.sh
  4. 1 1
      src/misfinanzas/settings.py

+ 0 - 62
Dockerfile.k8s

@@ -1,62 +0,0 @@
-# syntax=docker/dockerfile:1
-##################
-# BUILDER        #
-##################
-
-FROM python:3.11-slim AS builder
-
-# set work directory
-WORKDIR /app
-
-# set environment variables
-ENV PYTHONDONTWRITEBYTECODE=1
-ENV PYTHONUNBUFFERED=1
-
-# install system dependencies
-RUN apt-get update && \
-    apt-get install -y --no-install-recommends gcc
-
-# lint
-RUN pip install --upgrade pip
-RUN pip install flake8==6.0.0
-COPY . /app/
-RUN flake8 --ignore=E501,F401,E126,E722 .
-
-COPY ./src/requirements.txt .
-
-
-RUN pip wheel --no-cache-dir --no-deps --wheel-dir /app/wheels -r requirements.txt
-
-##################
-# FINAL          #
-##################
-
-FROM python:3.11-slim
-
-# create the appropriate directories
-ENV APP_HOME=/app
-RUN mkdir -p $APP_HOME
-
-WORKDIR $APP_HOME
-
-# install system dependencies
-RUN apt-get update && apt-get install nginx netcat-openbsd curl vim jq rsync libpango-1.0-0 libpangocairo-1.0-0 libcairo2 -y
-
-COPY --from=builder /app/wheels /wheels
-COPY --from=builder /app/requirements.txt .
-
-RUN pip install --upgrade pip
-RUN pip install --no-cache /wheels/*
-
-# copy entrypoint.sh
-COPY ./entrypoint.sh .
-
-# copy project
-COPY . $APP_HOME
-
-# change to the app user
-
-WORKDIR $APP_HOME/src
-
-# run entrypoint.sh
-ENTRYPOINT ["/app/entrypoint.sh"]

+ 1 - 1
Makefile

@@ -2,7 +2,7 @@ install:
 
 	echo "Creando imagen con version '${IMG_VERSION}' para la arquitectura '${ARQUITECTURA}' en el registry '${REGISTRY}'"
 
-	docker build --no-cache -t ${REGISTRY}/finanzas-${ARQUITECTURA}:${IMG_VERSION} -f Dockerfile.k8s .
+	docker build --no-cache -t ${REGISTRY}/finanzas-${ARQUITECTURA}:${IMG_VERSION} -f Dockerfile .
 	docker push ${REGISTRY}/finanzas-${ARQUITECTURA}:${IMG_VERSION}
 
 

+ 3 - 3
src/config/entrypoint.sh

@@ -1,8 +1,8 @@
 #!/bin/bash
 RUN_PORT="8000"
-DATABASE=postgres
-SQL_HOST=postgresql
-SQL_PORT=5432
+#DATABASE=postgres
+#SQL_HOST=postgresql
+#SQL_PORT=5432
 
 export PATH=/opt/venv/bin:$PATH
 

+ 1 - 1
src/misfinanzas/settings.py

@@ -152,7 +152,7 @@ THOUSAND_SEPARATOR = '.'
 
 STATIC_URL = 'static/'
 STATIC_ROOT = BASE_DIR / "staticfiles"
-STATICFILES_DIRS = [BASE_DIR / "static",]
+#STATICFILES_DIRS = [BASE_DIR / "static",]
 
 # Mediafiles