diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6dccc80 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM node:22-alpine AS build + +WORKDIR /web + +COPY package.json ./ + +RUN npm install + +COPY . . + +RUN npm run build + +FROM node:22-alpine AS runtime + +WORKDIR /app + +# Copiar archivos generados y dependencias necesarias +COPY --from=build /web/dist ./dist +COPY --from=build /web/node_modules ./node_modules +COPY --from=build /web/package.json ./package.json + +# Configuración de red interna de Docker +ENV HOST=0.0.0.0 +ENV PORT=4321 +EXPOSE 4321 + +CMD ["node", "./dist/server/entry.mjs"] \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..3ad8754 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,7 @@ +services: + web: + build: + context: . + dockerfile: Dockerfile + ports: + - "4321:4321" diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..83126be --- /dev/null +++ b/nginx.conf @@ -0,0 +1,15 @@ +server { + listen 80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} \ No newline at end of file