Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Quick Start with docker #183

zhuyifeiRuichuang started this conversation in Show and tell
Discussion options

If you want to quick start and join in devlopment, you can use to docker fast make it.

git clone https://github.com/pascalorg/editor.git
cd editor

create Dockerfile

# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
# Install bun package manager
RUN npm install -g bun
# Copy root configuration
COPY package.json bun.lock ./
COPY turbo.json ./
COPY biome.jsonc ./
# Copy packages
COPY packages ./packages
COPY tooling ./tooling
# Copy apps
COPY apps ./apps
# Install dependencies and build
RUN bun install --frozen-lockfile
RUN bun run build
# Production stage
FROM node:20-alpine
WORKDIR /app
# Install bun and curl for health check
RUN npm install -g bun && apk add --no-cache curl
# Copy package managers
COPY package.json bun.lock ./
# Copy built applications and packages
COPY --from=builder /app/packages ./packages
COPY --from=builder /app/tooling ./tooling
COPY --from=builder /app/apps ./apps
COPY --from=builder /app/node_modules ./node_modules
# Set working directory to editor app
WORKDIR /app/apps/editor
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
 CMD curl -f http://localhost:3000 || exit 1
# Use next start for production
CMD ["bun", "run", "start"]

create .dockerignore

node_modules
npm-debug.log
.git
.gitignore
.next
.env
.env.local
.env.*.local
.DS_Store
dist
build
coverage
.turbo
.vscode
.cursor
.claude

create docker-compose.yaml

services:
 pascal-editor:
 build:
 context: .
 dockerfile: Dockerfile
 container_name: pascal-editor
 ports:
 - "3000:3000"
 environment:
 - NODE_ENV=production
 - NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=${NEXT_PUBLIC_GOOGLE_MAPS_API_KEY:-}
 - PORT=3000
 restart: unless-stopped
 healthcheck:
 test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000"]
 interval: 30s
 timeout: 10s
 retries: 3
 start_period: 40s
 # opetion: limit
 # deploy:
 # resources:
 # limits:
 # cpus: '2'
 # memory: 2G
 # reservations:
 # cpus: '1'
 # memory: 1G

create .env ,if you want to use Google Maps API,

NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your_api_key_here

all start

docker compose up -d
You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /