Compare commits
39 Commits
46b85f5ee7
...
v0.1.7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
15ed12f0c6 | ||
| 5b3bd631cb | |||
|
|
3ea406044b | ||
|
|
4cd49d8c9a | ||
|
|
7a931d32ba | ||
| 01853b41ba | |||
| 8c2ffaae55 | |||
|
|
1976432a95 | ||
|
|
c25c6c2916 | ||
|
|
1a682c121e | ||
| c633124454 | |||
| 1030fa994c | |||
| 5707b1fbc4 | |||
|
|
d6db3d3e70 | ||
|
|
768e384ed6 | ||
|
|
b6dc8485c0 | ||
|
|
47070f71db | ||
|
|
5e688aa1fa | ||
| 232a687942 | |||
| b50e3c756c | |||
| 8cfce22f1d | |||
| 2433b48c35 | |||
| c5064383fe | |||
| 77b61d3f33 | |||
|
|
070af13d86 | ||
|
|
2a070ab921 | ||
|
|
7923b8c13e | ||
|
|
d924636def | ||
|
|
8bb952eba5 | ||
|
|
80df1368b1 | ||
|
|
a5fe8414de | ||
|
|
5edfd256c1 | ||
|
|
9f04467a6d | ||
|
|
f8323ea419 | ||
|
|
1cc463f659 | ||
|
|
caa7cfb564 | ||
|
|
559f49db8a | ||
|
|
57d2bcdd07 | ||
|
|
807bcc8034 |
@@ -1,11 +1,13 @@
|
|||||||
name: Workflow de prueba
|
name: Workflow de prueba
|
||||||
|
|
||||||
on:
|
on:
|
||||||
- push
|
pull_request_review:
|
||||||
|
types: [submitted]
|
||||||
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DOCKER_ORG: beyondcx
|
DOCKER_ORG: beyondcx
|
||||||
BRANCH_NAME: main
|
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Build and push images:
|
Build and push images:
|
||||||
@@ -14,33 +16,37 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Extract Branch Name
|
|
||||||
run: echo "BRANCH_NAME=${{ gitea.ref_name }}" >> env.BRANCH_NAME
|
|
||||||
|
|
||||||
#- name: Setup QEMU
|
|
||||||
# uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Setup Buildx
|
- name: Setup Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
driver-opts: network=host
|
driver-opts: network=host
|
||||||
|
|
||||||
- name: Login to Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: git.beyondcx.org
|
|
||||||
username: ${{ secrets.REGISTRY_USER }}
|
|
||||||
password: ${{ secrets.REGISTRY_PWD }}
|
|
||||||
|
|
||||||
- name: Echo the Tag
|
- name: Echo the Tag
|
||||||
run: echo "Tag ${{ env.DOCKER_ORG }}/beyondcx:${{ env.BRANCH_NAME }}"
|
run: echo "Tag ${{ env.DOCKER_ORG }}/beyondcx:${{ env.BRANCH_NAME }}"
|
||||||
|
|
||||||
- name: Build
|
- name: Login to Registry
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
context: .
|
registry: ${{ secrets.REGISTRY_URL }}
|
||||||
push: true
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
tags: ${{ env.DOCKER_ORG }}/beyondcx:${{ env.BRANCH_NAME }}
|
password: ${{ secrets.REGISTRY_PWD }}
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
|
- name: Build frontend and push it to registry
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: frontend
|
||||||
|
push: false
|
||||||
|
tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/frontend-analytics-demo:${{ env.BRANCH_NAME }}
|
||||||
|
platforms: linux/amd64
|
||||||
|
file: frontend/Dockerfile
|
||||||
|
|
||||||
|
- name: Build backend and push it to registry
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: backend
|
||||||
|
push: false
|
||||||
|
tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/backend-analytics-demo:${{ env.BRANCH_NAME }}
|
||||||
|
platforms: linux/amd64
|
||||||
|
file: backend/Dockerfile
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
52
.gitea/workflows/tag.yaml
Normal file
52
.gitea/workflows/tag.yaml
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
name: Tag Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [created,edited,published]
|
||||||
|
|
||||||
|
env:
|
||||||
|
DOCKER_ORG: beyondcx
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
new images:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Extract Tag Name
|
||||||
|
uses: olegtarasov/get-tag@v2.1.4
|
||||||
|
id: tagName
|
||||||
|
- name: Show tag
|
||||||
|
run: echo "$GIT_TAG_NAME";
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
driver-opts: network=host
|
||||||
|
|
||||||
|
- name: Login to Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ secrets.REGISTRY_URL }}
|
||||||
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
|
password: ${{ secrets.REGISTRY_PWD }}
|
||||||
|
|
||||||
|
- name: Build frontend and push it to registry
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: frontend
|
||||||
|
push: true
|
||||||
|
tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/frontend-analytics-demo:${{ steps.tagName.outputs.tag }}
|
||||||
|
platforms: linux/amd64
|
||||||
|
file: frontend/Dockerfile
|
||||||
|
|
||||||
|
- name: Build backend and push it to registry
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: backend
|
||||||
|
push: true
|
||||||
|
tags: ${{ secrets.REGISTRY_URL }}/${{ env.DOCKER_ORG }}/backend-analytics-demo:${{ steps.tagName.outputs.tag }}
|
||||||
|
platforms: linux/amd64
|
||||||
|
file: backend/Dockerfile
|
||||||
|
|
||||||
@@ -11,3 +11,8 @@ build
|
|||||||
data/output
|
data/output
|
||||||
*.zip
|
*.zip
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
*.log
|
||||||
|
Dockerfile
|
||||||
|
docker-compose.yml
|
||||||
|
.env
|
||||||
|
tests
|
||||||
|
|||||||
@@ -1,31 +1,50 @@
|
|||||||
# backend/Dockerfile
|
# ---------------------------
|
||||||
FROM python:3.11-slim
|
# Builder stage
|
||||||
|
# ---------------------------
|
||||||
|
FROM python:3.13-bookworm AS builder
|
||||||
|
|
||||||
# Evitar .pyc y buffering
|
# Solo herramientas necesarias para compilar dependencias
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
ENV PYTHONUNBUFFERED=1
|
build-essential && apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
ADD https://astral.sh/uv/install.sh /install.sh
|
||||||
|
RUN chmod -R 655 /install.sh && /install.sh && rm /install.sh
|
||||||
|
|
||||||
|
ENV PATH="/root/.local/bin:$PATH"
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Dependencias del sistema mínimas
|
# Copiamos solo archivos de dependencias (mejor cache)
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
||||||
build-essential \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Copiamos pyproject y lock si lo hubiera
|
|
||||||
COPY pyproject.toml ./
|
COPY pyproject.toml ./
|
||||||
|
|
||||||
# Instalamos dependencias
|
# Cambiamos pip por uv más moderno y rápido
|
||||||
RUN pip install --upgrade pip && \
|
RUN uv sync
|
||||||
pip install .
|
|
||||||
|
# ---------------------------
|
||||||
|
# Runtime stage
|
||||||
|
# ---------------------------
|
||||||
|
FROM python:3.13-slim-bookworm AS production
|
||||||
|
|
||||||
# Copiamos el resto del código (respetando .dockerignore)
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# Variables de autenticación básica
|
|
||||||
ENV BASIC_AUTH_USERNAME=admin
|
ENV BASIC_AUTH_USERNAME=admin
|
||||||
ENV BASIC_AUTH_PASSWORD=admin
|
ENV BASIC_AUTH_PASSWORD=admin
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Crear usuario no-root
|
||||||
|
RUN useradd --create-home appuser
|
||||||
|
|
||||||
|
# Copiamos código y producto uv
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
COPY --from=builder /app/.venv .venv
|
||||||
|
|
||||||
|
# Cambiar permisos
|
||||||
|
#RUN chown -R appuser:appuser /app
|
||||||
|
|
||||||
|
#USER appuser
|
||||||
|
ENV PATH="/app/.venv/bin:$PATH"
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
CMD ["python", "-m", "uvicorn", "beyond_api.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
CMD ["uvicorn", "beyond_api.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||||
|
|||||||
@@ -20,17 +20,22 @@ ENV VITE_API_BASE_URL=${VITE_API_BASE_URL}
|
|||||||
# Construimos el bundle
|
# Construimos el bundle
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# 2) Fase de servidor estático
|
# 2) Fase de servidor estático. Tenemos que revisar
|
||||||
FROM node:20-alpine
|
FROM node:20-alpine
|
||||||
|
#FROM nginx:alpine
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
#RUN rm -rf /usr/share/nginx/html/*
|
||||||
|
|
||||||
# Copiamos el build
|
# Copiamos el build
|
||||||
|
#COPY --from=build /app/dist /usr/share/nginx/html
|
||||||
COPY --from=build /app/dist ./dist
|
COPY --from=build /app/dist ./dist
|
||||||
|
|
||||||
# Server estático muy simple
|
# Server estático muy simple
|
||||||
RUN npm install -g serve
|
RUN npm install -g serve
|
||||||
|
|
||||||
|
#EXPOSE 80
|
||||||
EXPOSE 4173
|
EXPOSE 4173
|
||||||
|
|
||||||
|
#CMD ["nginx", "-g", "daemon off;"]
|
||||||
CMD ["serve", "-s", "dist", "-l", "4173"]
|
CMD ["serve", "-s", "dist", "-l", "4173"]
|
||||||
|
|||||||
Reference in New Issue
Block a user