usar dockerfile para el build
This commit is contained in:
parent
b6c7e0bd61
commit
abfd6992c5
2 changed files with 26 additions and 0 deletions
4
.dockerignore
Normal file
4
.dockerignore
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
node_modules
|
||||||
|
.next
|
||||||
|
.git
|
||||||
|
npm-debug.log
|
||||||
22
Dockerfile
Normal file
22
Dockerfile
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
# Dockerfile estándar para Next.js (modo server)
|
||||||
|
# Node fijo en 22-alpine: cumple los requisitos y es liviano y rápido.
|
||||||
|
FROM node:22-alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Instala dependencias usando el lockfile (reproducible)
|
||||||
|
COPY package.json package-lock.json* ./
|
||||||
|
RUN npm ci
|
||||||
|
|
||||||
|
# Copia el resto del código y compila
|
||||||
|
COPY . .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# Next.js escucha en el 3000
|
||||||
|
EXPOSE 3000
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
ENV PORT=3000
|
||||||
|
ENV HOSTNAME=0.0.0.0
|
||||||
|
|
||||||
|
# Arranca en modo server (SSR / API routes)
|
||||||
|
CMD ["npm", "start"]
|
||||||
Loading…
Reference in a new issue