Skip to content

Commit 0ca694c

Browse files
committed
docs(paste-server-rs): add README.md and production.compose.yml for paste-server-rs
1 parent 3754f59 commit 0ca694c

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed

paste-server-rs/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# paste-server-rs
2+
3+
[![paste-server-rs](https://github.com/AOSC-Dev/website-2023-utils/actions/workflows/paste-server-rs.yml/badge.svg?branch=master)](https://github.com/AOSC-Dev/website-2023-utils/actions/workflows/paste-server-rs.yml)
4+
5+
## Develop (with docker)
6+
7+
Build:
8+
```shell
9+
docker compose up --build
10+
```
11+
12+
Test:
13+
```shell
14+
echo "test" | curl -F "c=@-" http://localhost:2334/ | jq
15+
```
16+
17+
## Deploy
18+
19+
At `/opt/paste-server-rs/`:
20+
- Copy or link the `production.compose.yml` to `compose.yml`
21+
- Create a `.env` file
22+
- Run `docker compose up -d`
23+
24+
`.env` file example:
25+
```
26+
POSTGRES_USER=postgres
27+
POSTGRES_PASSWORD=somepassword
28+
POSTGRES_DB=paste
29+
```

paste-server-rs/compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ services:
1010
- contents:/app/contents
1111
environment:
1212
- PASTE_LISTEN_ADDRESS=0.0.0.0:2334
13-
- DATABASE_URL=postgresql://postgres:password@db/paste
1413
- PASTE_DB_ADDRESS=postgresql://postgres:password@db/paste
1514
- PASTE_FILE_DIR=/app/contents
1615
- PUBLIC_PASTE_URL=http://localhost:2334
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
services:
2+
app:
3+
image: ghcr.io/aosc-dev/paste-server-rs:master
4+
container_name: paste-server-rs
5+
depends_on:
6+
- db
7+
ports:
8+
- "127.0.0.1:2334:2334"
9+
volumes:
10+
- contents:/app/contents
11+
environment:
12+
- PASTE_LISTEN_ADDRESS=0.0.0.0:2334
13+
- PASTE_DB_ADDRESS=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db/${POSTGRES_DB}
14+
- PASTE_FILE_DIR=/app/contents
15+
- PUBLIC_PASTE_URL=https://paste.aosc.io
16+
17+
db:
18+
image: postgres:17
19+
container_name: paste-db
20+
volumes:
21+
- postgres_data:/var/lib/postgresql/data
22+
environment:
23+
- POSTGRES_USER=${POSTGRES_USER}
24+
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
25+
- POSTGRES_DB=${POSTGRES_DB}
26+
27+
volumes:
28+
postgres_data:
29+
contents:

0 commit comments

Comments
 (0)