Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/howtodo1/printer-web/llms.txt

Use this file to discover all available pages before exploring further.

PenPrint ships with a multi-stage Dockerfile that produces a lean, production-ready image. The build process separates development dependencies, production dependencies, and the compiled output so the final image stays small and contains only what’s needed to run the app.

Prerequisites

Before you begin, make sure you have the following:
  • Docker installed and running on your machine
  • The PenPrint repository cloned locally
git clone https://github.com/howtodo1/printer-web.git
cd printer-web

Build and run

1

Build the Docker image

Run the following command from the printer-web directory, where the Dockerfile lives:
docker build -t penprint .
Docker executes four stages during the build. See How the multi-stage build works below for a breakdown of each stage.
2

Run the container

Start PenPrint and bind it to port 3000 on your host:
docker run -p 3000:3000 penprint
The app is now available at http://localhost:3000.
3

Verify the app is running

Open your browser and navigate to http://localhost:3000. You should see the PenPrint interface ready to accept input.

How the multi-stage build works

The Dockerfile uses four named stages to keep the final image as small as possible:
StageBase imagePurpose
development-dependencies-envnode:20-alpineInstalls all dependencies (including devDependencies) needed to compile the app
production-dependencies-envnode:20-alpineInstalls only production dependencies (npm ci --omit=dev)
build-envnode:20-alpineRuns react-router build to compile the SSR bundle
Final (unnamed)node:20-alpineCopies the compiled output and production node_modules, then starts the server
The final image contains no build tools or dev dependencies — only the compiled build/ directory, production node_modules, and the Node.js runtime. The app starts with:
npm run start
# → react-router-serve ./build/server/index.js
react-router-serve listens on port 3000 by default.
The “Send to me!” feature uses Supabase to store and share your SVG artwork with the maintainer. The Supabase URL and anon key are embedded directly in the source code — this is intentional, as the anon key is a publishable key designed to be exposed on the client. No additional environment variables or secrets are required to enable this feature.

Docker Compose example

For a more convenient local or server setup, use Docker Compose:
services:
  penprint:
    build: .
    ports:
      - "3000:3000"
    restart: unless-stopped
Save this file as docker-compose.yml in the printer-web directory, then run:
docker compose up -d
To stop the container:
docker compose down

Next steps

Environment & build requirements

Learn about the Node.js version requirement, npm scripts, and static assets that must be present at runtime.

Back to home

Return to the PenPrint documentation home page.

Build docs developers (and LLMs) love