Skip to content
Draft
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
41 changes: 41 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Docker ignore file for text-cleanup

node_modules
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Development files
.git
.gitignore
.vercel
.env*

# Web application files (not needed in CLI Docker image)
index.html
script.js
styles.css
vercel.json

# Documentation and development files
README.md
.vscode
.idea

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Test files
test/
tests/
*.test.js

# Temporary files
tmp/
temp/
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ Thumbs.db
# Temporary files
/tmp/
.vercel

# Test files for development
test-files/
README.md.backup
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM node:18-alpine

# Set working directory
WORKDIR /app

# Copy package files
COPY package*.json ./

# Install dependencies (if any) - use npm install since no package-lock exists
RUN npm install --only=production

# Copy source code
COPY lib/ ./lib/
COPY bin/ ./bin/

# Make CLI executable
RUN chmod +x bin/text-cleanup

# Create a non-root user
RUN addgroup -g 1001 -S textcleanup && \
adduser -S textcleanup -u 1001

# Change to non-root user
USER textcleanup

# Set entrypoint to the CLI
ENTRYPOINT ["node", "bin/text-cleanup"]

# No default CMD, so it can process stdin by default
Loading