Compare commits
39 Commits
083e398f5d
...
v0.1.5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
46b85f5ee7 | ||
|
|
d252607c79 |
@@ -1,11 +1,13 @@
|
||||
name: Workflow de prueba
|
||||
|
||||
on:
|
||||
- push
|
||||
pull_request_review:
|
||||
types: [submitted]
|
||||
|
||||
|
||||
env:
|
||||
DOCKER_ORG: beyondcx
|
||||
BRANCH_NAME: main
|
||||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
||||
|
||||
jobs:
|
||||
Build and push images:
|
||||
@@ -14,33 +16,37 @@ jobs:
|
||||
- name: Checkout
|
||||
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
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
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
|
||||
run: echo "Tag ${{ env.DOCKER_ORG }}/beyondcx:${{ env.BRANCH_NAME }}"
|
||||
|
||||
- name: Build
|
||||
uses: docker/build-push-action@v3
|
||||
- name: Login to Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
context: .
|
||||
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: false
|
||||
tags: ${{ env.DOCKER_ORG }}/beyondcx:${{ env.BRANCH_NAME }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
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
|
||||
|
||||
|
||||
|
||||
49
.gitea/workflows/tag.yaml
Normal file
49
.gitea/workflows/tag.yaml
Normal file
@@ -0,0 +1,49 @@
|
||||
name: Tag Release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created,edited,published]
|
||||
|
||||
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:${{ step.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:${{ step.tagName.outputs.tag }}
|
||||
platforms: linux/amd64
|
||||
file: backend/Dockerfile
|
||||
|
||||
@@ -11,3 +11,8 @@ build
|
||||
data/output
|
||||
*.zip
|
||||
.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
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
# Solo herramientas necesarias para compilar dependencias
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
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
|
||||
|
||||
# Dependencias del sistema mínimas
|
||||
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
|
||||
# Copiamos solo archivos de dependencias (mejor cache)
|
||||
COPY pyproject.toml ./
|
||||
|
||||
# Instalamos dependencias
|
||||
RUN pip install --upgrade pip && \
|
||||
pip install .
|
||||
# Cambiamos pip por uv más moderno y rápido
|
||||
RUN uv sync
|
||||
|
||||
# ---------------------------
|
||||
# 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_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
|
||||
|
||||
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
|
||||
RUN npm run build
|
||||
|
||||
# 2) Fase de servidor estático
|
||||
# 2) Fase de servidor estático. Tenemos que revisar
|
||||
FROM node:20-alpine
|
||||
#FROM nginx:alpine
|
||||
|
||||
WORKDIR /app
|
||||
#RUN rm -rf /usr/share/nginx/html/*
|
||||
|
||||
# Copiamos el build
|
||||
#COPY --from=build /app/dist /usr/share/nginx/html
|
||||
COPY --from=build /app/dist ./dist
|
||||
|
||||
# Server estático muy simple
|
||||
RUN npm install -g serve
|
||||
|
||||
#EXPOSE 80
|
||||
EXPOSE 4173
|
||||
|
||||
#CMD ["nginx", "-g", "daemon off;"]
|
||||
CMD ["serve", "-s", "dist", "-l", "4173"]
|
||||
|
||||
Reference in New Issue
Block a user