-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Quick Start with docker #183
zhuyifeiRuichuang
started this conversation in
Show and tell
-
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 editorcreate 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
.claudecreate 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
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment