Skip to content

Commit

Permalink
Add docker install instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
v1k45 committed Jun 30, 2024
1 parent ec38382 commit e60923d
Showing 1 changed file with 47 additions and 22 deletions.
69 changes: 47 additions & 22 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,55 @@ PastePass is a single-binary, no dependency, fast and lightweight web service wr

### How to use

#### Docker

Easiest way to run PastePass is using Docker. Run the following command to start the service:

```bash
docker run -p 8008:8008 -v ./:/data ghcr.io/v1k45/pastepass
```

You can also use the image in a docker-compose file:

```yaml
version: '3'
services:
pastepass:
image: ghcr.io/v1k45/pastepass:latest
ports:
- "8008:8008"
volumes:
- ./data/:/data
```
You can customize the options by passing them as command line arguments to docker-compose:
```yaml
version: '3'
services:
pastepass:
image: ghcr.io/v1k45/pastepass:latest
command: ["pastepass", "-app-name", "MyPastePass", "-server-addr", ":8080"]
ports:
- "8080:8080"
volumes:
- ./data/:/data
```
#### Download
Download the binary from the [releases](https://github.com/v1k45/pastepass/releases/latest) page or build it from source:
Download the binary from the [releases](https://github.com/v1k45/pastepass/releases/latest) page or build it from source.
#### Download binary
Here is a shortcut to download the binary for your platform:
```bash
curl -L "https://github.com/v1k45/pastepass/releases/latest/download/pastepass-$(uname | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/amd64/; s/i[3-6]86/386/; s/aarch64/arm64/; s/armv7l/arm/')" -o pastepass
chmod +x pastepass
```

#### Build from source

```bash
git clone https://github.com/v1k45/pastepass.git
Expand All @@ -29,13 +75,6 @@ The binary will be created in the `bin/` directory. If you are downloading the
chmod +x pastepass-linux-amd64
```

Here is a shortcut to download the binary for your platform:

```bash
curl -L "https://github.com/v1k45/pastepass/releases/latest/download/pastepass-$(uname | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/amd64/; s/i[3-6]86/386/; s/aarch64/arm64/; s/armv7l/arm/')" -o pastepass
chmod +x pastepass
```

#### Run

Run with default options:
Expand All @@ -52,20 +91,6 @@ Use the `-h` option to find all options:
./pastepass -h
```

#### Run with docker

Build the image

```bash
git clone https://github.com/v1k45/pastepass.git && cd pastepass
docker build -t pastepass .
```

Run the image on the port 10001 with a volume mounted in `path/on/host` to store the database. ()
```bash
docker run -p 10001:8008 -v /path/on/host:/data pastepass
```

#### Options

| Option | Description | Default |
Expand Down

0 comments on commit e60923d

Please sign in to comment.