36 lines
1010 B
Docker
36 lines
1010 B
Docker
# Dockerfile to test npx @ruvector/postgres-cli installation
|
|
# This simulates a clean environment where a user would run npx
|
|
|
|
FROM node:20-slim
|
|
|
|
# Install Docker client (for Docker-based installation testing)
|
|
RUN apt-get update && apt-get install -y \
|
|
docker.io \
|
|
curl \
|
|
ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Create test user (non-root for realistic testing)
|
|
RUN useradd -m -s /bin/bash testuser
|
|
USER testuser
|
|
WORKDIR /home/testuser
|
|
|
|
# Set npm config for cleaner output
|
|
ENV npm_config_update_notifier=false
|
|
ENV npm_config_fund=false
|
|
|
|
# Test that npx works
|
|
RUN npx --version
|
|
|
|
# Copy the local package tarball (will be created before docker build)
|
|
COPY --chown=testuser:testuser ruvector-postgres-cli.tgz /home/testuser/
|
|
|
|
# Install from local tarball to simulate npx behavior
|
|
RUN npm install ./ruvector-postgres-cli.tgz
|
|
|
|
# Add node_modules/.bin to PATH for CLI access
|
|
ENV PATH="/home/testuser/node_modules/.bin:${PATH}"
|
|
|
|
# Default command to show help
|
|
CMD ["ruvector-pg", "--help"]
|