mirror of
https://github.com/LukeHagar/arbiter.git
synced 2025-12-09 20:37:50 +00:00
Adding docker support
This commit is contained in:
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
FROM node:20-slim
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy package files
|
||||||
|
COPY package*.json ./
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
# Copy source code
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Build TypeScript code
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# Expose ports for proxy and docs servers
|
||||||
|
EXPOSE 3000 3001
|
||||||
|
|
||||||
|
# Set default command
|
||||||
|
CMD ["node", "dist/src/cli.js"]
|
||||||
26
README.md
26
README.md
@@ -41,6 +41,32 @@ And view the automatically generated documentation:
|
|||||||
open http://localhost:3001/docs
|
open http://localhost:3001/docs
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Docker Usage
|
||||||
|
|
||||||
|
You can run Arbiter using Docker:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Build the Docker image
|
||||||
|
docker build -t arbiter .
|
||||||
|
|
||||||
|
# Run the container
|
||||||
|
docker run -p 3000:3000 -p 3001:3001 arbiter --target https://api.example.com
|
||||||
|
```
|
||||||
|
|
||||||
|
The container exposes:
|
||||||
|
- Port 3000 for the proxy server
|
||||||
|
- Port 3001 for the documentation server
|
||||||
|
|
||||||
|
You can customize the ports and other options:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run -p 8080:8080 -p 8081:8081 arbiter \
|
||||||
|
--target https://api.example.com \
|
||||||
|
--proxy-port 8080 \
|
||||||
|
--docs-port 8081 \
|
||||||
|
--verbose
|
||||||
|
```
|
||||||
|
|
||||||
## Usage Options
|
## Usage Options
|
||||||
|
|
||||||
| Option | Description | Default |
|
| Option | Description | Default |
|
||||||
|
|||||||
Reference in New Issue
Block a user