This guide provides comprehensive instructions for running redep server using Docker. The Docker image is optimized for size and security, based on Alpine Linux.
docker pull nafies1/redep:latest
To run the server, you need to provide a Secret Key and mount the Docker Socket (so redep can execute Docker commands on the host).
docker run -d \
--name redep-server \
--restart always \
-p 3000:3000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(pwd)/workspace:/app/workspace \
-e SECRET_KEY=your-super-secret-key \
-e WORKING_DIR=/app/workspace \
-e DEPLOYMENT_COMMAND="docker compose up -d" \
nafies1/redep:latest
docker run -d `
--name redep-server `
--restart always `
-p 3000:3000 `
-v /var/run/docker.sock:/var/run/docker.sock `
-v ${PWD}/workspace:/app/workspace `
-e SECRET_KEY=your-super-secret-key `
-e WORKING_DIR=/app/workspace `
-e DEPLOYMENT_COMMAND="docker compose up -d" `
nafies1/redep:latest
docker run -d ^
--name redep-server ^
--restart always ^
-p 3000:3000 ^
-v /var/run/docker.sock:/var/run/docker.sock ^
-v %cd%/workspace:/app/workspace ^
-e SECRET_KEY=your-super-secret-key ^
-e WORKING_DIR=/app/workspace ^
-e DEPLOYMENT_COMMAND="docker compose up -d" ^
nafies1/redep:latest
| Variable | Description | Default | Required |
|---|---|---|---|
SECRET_KEY | Secret token for authentication with the client. | - | Yes |
WORKING_DIR | Directory inside the container where commands are executed. | - | Yes |
DEPLOYMENT_COMMAND | Command to execute when a deployment is triggered. | - | Yes |
SERVER_PORT | Port the server listens on inside the container. | 3000 | No |
NODE_ENV | Node.js environment mode. | production | No |
| Host Path | Container Path | Purpose |
|---|---|---|
/var/run/docker.sock | /var/run/docker.sock | Required. Allows the container to control the host's Docker daemon. |
./workspace | /app/workspace | Recommended. Persist your project files (e.g., docker-compose.yml) so they survive container restarts. |
Create a docker-compose.redep.yml:
services:
redep-server:
image: nafies1/redep:latest
container_name: redep-server
restart: always
ports:
- '3000:3000'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./my-project:/app/workspace
environment:
- SECRET_KEY=change-me-to-something-secure
- WORKING_DIR=/app/workspace
- DEPLOYMENT_COMMAND=docker compose pull && docker compose up -d
Run with:
docker compose -f docker-compose.redep.yml up -d
services:
redep-server:
image: nafies1/redep:latest
networks:
- web
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./workspace:/app/workspace
environment:
- SECRET_KEY=${REDEP_SECRET}
- WORKING_DIR=/app/workspace
- DEPLOYMENT_COMMAND=docker compose up -d --build
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.redep.rule=Host(`deploy.example.com`)'
networks:
web:
external: true
docker: not found or permission denied.-v /var/run/docker.sock:/var/run/docker.sock. On some systems, you may need to run the container with --group-add $(getent group docker | cut -d: -f3) or user: root (though root is not recommended if avoidable).xhr poll error.docker ps. Ensure -p 3000:3000 matches the internal SERVER_PORT.WORKING_DIR.WORKING_DIR path exists inside the container. Mounting a volume automatically creates the directory.root by default to access the Docker socket easily. For higher security, consider using a non-root user and adding them to the docker group (requires custom image extension).SECRET_KEY to version control. Use .env files (excluded from git) or Docker Secrets./var/run/docker.sock gives the container full control over the host. Ensure only trusted commands are executed via DEPLOYMENT_COMMAND.node:20-alpine for a lightweight footprint (<100MB).--memory="256m" --cpus="0.5"
| redep Version | Docker Tag | Node.js Version |
|---|---|---|
| 2.x | latest | 20 (LTS) |
| 1.x | v1 | 18 |
Content type
Image
Digest
sha256:2c5f8fb31…
Size
93.6 MB
Last updated
6 months ago
docker pull nafies1/redep