Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Dependencies
node_modules
**/node_modules

# Build outputs
.nuxt
.output
dist
app/.nuxt
app/.output
app/dist
parser/dist

# Git
.git
.gitignore
.github

# Development files
*.md
!README.md
.vscode
.idea

# Environment files
.env
.env.local
.env.*.local

# Logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*

# OS
.DS_Store
Thumbs.db

# Testing
coverage
.nyc_output
tests/assets/*.jpg
!tests/assets/test01.jpg

# Docker
Dockerfile
.dockerignore
docker-compose.yml
59 changes: 59 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Multi-stage Dockerfile for IPTC Web Editor (Nuxt.js + pnpm workspace)

# Stage 1: Build
FROM node:24-alpine AS builder

# Install pnpm
RUN corepack enable && corepack prepare pnpm@10.12.4 --activate

WORKDIR /editor

# Copy workspace configuration and app package files
COPY pnpm-workspace.yaml pnpm-lock.yaml ./
COPY app/package.json app/pnpm-lock.yaml ./app/

# Copy parser module (needed for prepare script during install)
COPY parser ./parser

# Install dependencies (parser builds via prepare script)
RUN pnpm install --frozen-lockfile

# Copy app module
COPY app ./app

# Build Nuxt app (parser builds automatically via prepare script)
RUN pnpm -C app build

# Stage 2: Production runtime
FROM node:24-alpine AS runner

RUN corepack enable && corepack prepare pnpm@10.12.4 --activate

WORKDIR /editor

# Set NODE_ENV to production
ENV NODE_ENV=production

# Copy workspace configuration
COPY --from=builder /editor/pnpm-workspace.yaml ./
COPY --from=builder /editor/pnpm-lock.yaml ./

# Copy parser package (built)
COPY --from=builder /editor/parser/package.json ./parser/
COPY --from=builder /editor/parser/dist ./parser/dist

# Copy app package.json and built files
COPY --from=builder /editor/app/package.json ./app/
COPY --from=builder /editor/app/.output ./app/.output

# Install only production dependencies
RUN pnpm install --frozen-lockfile --prod --ignore-scripts

# Expose port 3000
EXPOSE 3000

# Set working directory to app
WORKDIR /editor/app

# Start the Nuxt application
CMD ["pnpm", "start"]
6 changes: 4 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
"lint": "eslint --ext .ts,.vue ."
"lint": "eslint --ext .ts,.vue .",
"start": "node .output/server/index.mjs"
},
"dependencies": {
"@iconify-json/lucide": "^1.2.82",
"@internationalized/date": "^3.10.0",
"@nuxt/eslint": "1.4.1",
"@nuxt/fonts": "0.11.4",
Expand All @@ -20,6 +22,7 @@
"@nuxt/ui": "^4.1.0",
"@vueuse/core": "^13.9.0",
"@vueuse/integrations": "^13.9.0",
"@vueuse/nuxt": "^13.9.0",
"async-validator": "^4.2.5",
"browser-fs-access": "^0.38.0",
"idb-keyval": "^6.2.2",
Expand All @@ -34,7 +37,6 @@
"packageManager": "pnpm@10.12.4",
"devDependencies": {
"@antfu/eslint-config": "^4.14.1",
"@vueuse/nuxt": "^13.9.0",
"eslint": "^9.29.0"
}
}
16 changes: 13 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.