nuxt-ui-pro / docs

A documentation template made with Nuxt UI Pro.
https://docs-template.nuxt.dev
134 stars 38 forks source link

Unable to Selfhost Deploy using Docker Compose #76

Closed Type-32 closed 1 month ago

Type-32 commented 1 month ago

For context: pnpm run dev and pnpm run build runs just fine, but running node .output/server/index.mjs to actual run the website fails

Logs:

(base) ~/Documents/WebStorm Projects/docs git:[main]
node .output/server/index.mjs
node:internal/modules/esm/resolve:263
    throw new ERR_MODULE_NOT_FOUND(
          ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/administrator/Documents/WebStorm Projects/docs/.output/server/node_modules/shiki/dist/core.mjs' imported from /Users/administrator/Documents/WebStorm Projects/docs/.output/server/index.mjs
    at finalizeResolution (node:internal/modules/esm/resolve:263:11)
    at moduleResolve (node:internal/modules/esm/resolve:908:10)
    at defaultResolve (node:internal/modules/esm/resolve:1131:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:390:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:359:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:234:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
    at link (node:internal/modules/esm/module_job:84:36) {
  code: 'ERR_MODULE_NOT_FOUND',
  url: 'file:///Users/administrator/Documents/WebStorm%20Projects/docs/.output/server/node_modules/shiki/dist/core.mjs'
}

Node.js v21.6.0

Repo: https://github.com/CRTL-Prototype-Studios/docs

My Dockerfile and docker-compose.yml: (I have .env file when docker-compose up)

FROM node:18-alpine

# Install pnpm
RUN npm install -g pnpm

ARG NUXT_UI_PRO_LICENSE
ENV NUXT_UI_PRO_LICENSE=$NUXT_UI_PRO_LICENSE
ARG SITE_PORT
ENV SITE_PORT=$SITE_PORT
ARG NUXT_PUBLIC_SITE_URL
ENV NUXT_PUBLIC_SITE_URL=$NUXT_PUBLIC_SITE_URL

WORKDIR /app

COPY package*.json ./
COPY pnpm-lock.yaml ./
COPY .npmrc ./

# Use pnpm to install dependencies
RUN pnpm install --frozen-lockfile

COPY . .

# Build the application
RUN pnpm run build

ENV HOST 0.0.0.0
EXPOSE 3000

# Uncomment the CMD
CMD ["node", ".output/server/index.mjs"]
version: '3'

services:
  documentation:
    image: type32/documentation:latest
    ports:
      - "${SITE_PORT}:3000"
    restart: on-failure
benjamincanac commented 1 month ago

This is due to an upstream issue of nuxt-og-image, you can solve this by setting the resolution to 3.0.0-rc.56 for now: https://github.com/nuxt-ui-pro/docs/commit/e9b51a41b39245a7a951cd6bb16464bd2c21b35d.

benjamincanac commented 1 month ago

It should be fixed with nuxt-og-image@3.0.0-rc.64.