Created
April 12, 2026 13:12
-
-
Save Alexander-0x80/443d7d95c6399e05c704d9e354174ff9 to your computer and use it in GitHub Desktop.
Dockerfile ( for running paperclip containers )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM debian:bookworm-slim | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| ENV NODE_VERSION=20.20.2 | |
| ENV PNPM_VERSION=9.15.9 | |
| ENV PNPM_HOME=/pnpm | |
| ENV PATH=/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:${PNPM_HOME} | |
| RUN groupadd --gid 10001 appuser \ | |
| && useradd --uid 10001 --gid 10001 --create-home --shell /bin/bash appuser \ | |
| && mkdir -p /app /pnpm \ | |
| && chown -R appuser:appuser /app /pnpm /home/appuser | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| ca-certificates \ | |
| curl \ | |
| xz-utils \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install official Node.js 20 Linux x64 binary | |
| RUN ARCH="$(dpkg --print-architecture)" && \ | |
| case "$ARCH" in \ | |
| amd64) NODE_ARCH="x64" ;; \ | |
| arm64) NODE_ARCH="arm64" ;; \ | |
| *) echo "Unsupported architecture: $ARCH" && exit 1 ;; \ | |
| esac && \ | |
| curl -fsSLO "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" && \ | |
| tar -xJf "node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" -C /usr/local --strip-components=1 --no-same-owner && \ | |
| rm "node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" | |
| # Enable Corepack and pin pnpm 9 | |
| RUN mkdir -p ${PNPM_HOME} && \ | |
| corepack enable && \ | |
| corepack prepare pnpm@${PNPM_VERSION} --activate | |
| WORKDIR /app | |
| USER appuser | |
| # Your app should bind to 0.0.0.0:3100 inside the container | |
| ENV HOST=0.0.0.0 | |
| ENV PORT=3100 | |
| EXPOSE 3100 | |
| CMD ["bash"] |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Build Image
docker build -t paperclip .
Run the container and leep it around
docker run -d
--name paperclip_dev
--network host
-v "$PWD/appuser-home":/home/appuser
paperclip
sleep infinity
Open Shell
docker exec -it container_name bash
Stop/Start
docker stop container_name
docker start container_name
Stop all containers
docker stop $(docker ps -a -q)
See running containers
docker ps
docker ps -a
See container logs
docker logs container_name
Remove container
docker rm -f container_name
Remove all containers
docker rm $(docker ps -a -q)