Update self-hosting instructions
This commit is contained in:
21
README.md
21
README.md
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
**paste is a simple web app for writing & sharing code.** It's my own take on conventional pastebin sites like _pastebin.com_ or _hastebin_.
|
**paste is a simple web app for writing & sharing code.** It's my own take on conventional pastebin sites like _pastebin.com_ or _hastebin_.
|
||||||
|
|
||||||
Anyone can use paste! The official/public instance can be accessed using the endpoints listed below, but you can also [host your own](#host-your-own) if you like!
|
Anyone can use paste! The official/public instance can be accessed using the endpoints listed below, but you can also [host your own](#self-hosting) if you like!
|
||||||
|
|
||||||
##### 1) In a Web Browser
|
##### 1) In a Web Browser
|
||||||
Just go to https://pastes.dev!
|
Just go to https://pastes.dev!
|
||||||
@@ -90,28 +90,13 @@ The API is powered by the [bytebin](https://github.com/lucko/bytebin) service, s
|
|||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
### Host your own
|
### Self-hosting
|
||||||
|
|
||||||
It's quite simple to host your own version.
|
The easiest way to self-host is using Docker (& Docker Compose). You can run the following commands to get started:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/lucko/paste
|
git clone https://github.com/lucko/paste
|
||||||
cd paste
|
cd paste
|
||||||
yarn install
|
|
||||||
|
|
||||||
# Outputs html/css/js files to /build
|
|
||||||
yarn build
|
|
||||||
|
|
||||||
# Start a webserver for testing/development
|
|
||||||
yarn start
|
|
||||||
```
|
|
||||||
|
|
||||||
You can then follow the [create-react-app deployment documentation](https://create-react-app.dev/docs/deployment/) for how to host the build output. I personally recommend deploying to the cloud using a service like Netlify instead of hosting on your own webserver.
|
|
||||||
|
|
||||||
If you really want to self-host (including the bytebin data storage part), I suggest using Docker:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/lucko/paste
|
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
version: '3.8'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
|
# frontend service
|
||||||
paste:
|
paste:
|
||||||
image: ghcr.io/lucko/paste
|
image: ghcr.io/lucko/paste
|
||||||
|
|
||||||
|
# backend service
|
||||||
bytebin:
|
bytebin:
|
||||||
image: ghcr.io/lucko/bytebin
|
image: ghcr.io/lucko/bytebin
|
||||||
volumes:
|
volumes:
|
||||||
@@ -11,6 +12,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
BYTEBIN_MISC_KEYLENGTH: 5
|
BYTEBIN_MISC_KEYLENGTH: 5
|
||||||
|
|
||||||
|
# reverse proxy
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:alpine
|
image: nginx:alpine
|
||||||
command: ['nginx', '-g', 'daemon off;']
|
command: ['nginx', '-g', 'daemon off;']
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# nginx reverse proxy configuration for paste+bytebin
|
# nginx reverse proxy configuration for paste frontend & bytebin backend
|
||||||
server {
|
server {
|
||||||
listen 80 default_server;
|
listen 80 default_server;
|
||||||
|
|
||||||
# paste app
|
# proxy / path to paste frontend
|
||||||
location / {
|
location / {
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
@@ -17,7 +17,7 @@ server {
|
|||||||
return 404;
|
return 404;
|
||||||
}
|
}
|
||||||
|
|
||||||
# proxy /data endpoint to bytebin
|
# proxy /data path to bytebin backend
|
||||||
location /data/ {
|
location /data/ {
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
|||||||
Reference in New Issue
Block a user