fix(docker): add canvas native deps for jsdom/vitest
canvas is an optional dependency of jsdom (used by vitest) and requires native libraries (cairo, pango, pixman) to build on Alpine. Add these dependencies to the base stage. Also fix legacy ENV format warnings. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
473b7dbd7c
commit
5f51bc1871
22
Dockerfile
22
Dockerfile
|
|
@ -1,8 +1,20 @@
|
||||||
# Multi-stage build for Soroban Abacus Flashcards
|
# Multi-stage build for Soroban Abacus Flashcards
|
||||||
FROM node:20-alpine AS base
|
FROM node:20-alpine AS base
|
||||||
|
|
||||||
# Install Python and build tools for better-sqlite3
|
# Install Python, build tools for better-sqlite3, and canvas native dependencies
|
||||||
RUN apk add --no-cache python3 py3-setuptools make g++
|
# canvas is an optional dep of jsdom (used by vitest) and requires cairo/pango
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
python3 \
|
||||||
|
py3-setuptools \
|
||||||
|
make \
|
||||||
|
g++ \
|
||||||
|
pkgconfig \
|
||||||
|
cairo-dev \
|
||||||
|
pango-dev \
|
||||||
|
libjpeg-turbo-dev \
|
||||||
|
giflib-dev \
|
||||||
|
librsvg-dev \
|
||||||
|
pixman-dev
|
||||||
|
|
||||||
# Install pnpm and turbo
|
# Install pnpm and turbo
|
||||||
RUN npm install -g pnpm@9.15.4 turbo@1.10.0
|
RUN npm install -g pnpm@9.15.4 turbo@1.10.0
|
||||||
|
|
@ -155,9 +167,9 @@ RUN mkdir -p data/uploads && chown -R nextjs:nodejs data
|
||||||
|
|
||||||
USER nextjs
|
USER nextjs
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
ENV PORT 3000
|
ENV PORT=3000
|
||||||
ENV HOSTNAME "0.0.0.0"
|
ENV HOSTNAME="0.0.0.0"
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
# Start the application
|
# Start the application
|
||||||
CMD ["node", "server.js"]
|
CMD ["node", "server.js"]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue