chore: update Dockerfile and .dockerignore to clarify environment variable handling and improve build context; adjust Footer component to use dynamic base URL for logo

This commit is contained in:
Alexis
2026-05-13 12:59:47 +02:00
parent cd9ad28a98
commit a3b9082a71
3 changed files with 9 additions and 4 deletions
+3 -2
View File
@@ -16,8 +16,9 @@ build/
.vite/ .vite/
*.timestamp-* *.timestamp-*
# Secretos: docker-compose ya inyecta las variables vía `env_file`, # Secretos: no subir `.env` al contexto de `docker build` (evita capas con claves).
# no necesitamos copiarlos al filesystem de la imagen. # `env_file` en compose aplica al proceso en ejecución del servicio, no al paso
# `npm run build` del Dockerfile; las `VITE_*` deben estar disponibles ahí (ENV/ARG).
.env .env
.env.* .env.*
!.env.example !.env.example
+5 -1
View File
@@ -7,7 +7,11 @@ COPY package.json package-lock.json ./
RUN npm ci RUN npm ci
COPY . . COPY . .
RUN npm run build # genera dist/ con base=/orcid2words/ # `env_file` en docker-compose solo inyecta variables en el contenedor al ARRANCAR
# (aquí nginx no usa Vite). `vite build` corre en esta fase y necesita `VITE_*`
# ya definidas: `.env` no entra en el contexto de build (.dockerignore).
ENV VITE_BASE_PATH=/orcid2words/
RUN npm run build
# ── Serve stage ──────────────────────────────────────────────── # ── Serve stage ────────────────────────────────────────────────
FROM nginx:alpine FROM nginx:alpine
+1 -1
View File
@@ -55,7 +55,7 @@ export default function Footer() {
<span className="text-[10px] font-medium uppercase leading-none tracking-[0.22em] text-ink-tertiary">de Jaén</span> <span className="text-[10px] font-medium uppercase leading-none tracking-[0.22em] text-ink-tertiary">de Jaén</span>
</div> </div>
<img <img
src="/uja-logo.png" src={`${import.meta.env.BASE_URL}uja-logo.png`}
alt="Logo UJA" alt="Logo UJA"
className="h-7 w-7 object-contain grayscale opacity-80 transition-all group-hover:grayscale-0 group-hover:opacity-100" className="h-7 w-7 object-contain grayscale opacity-80 transition-all group-hover:grayscale-0 group-hover:opacity-100"
/> />