Skip to content

Commit 1b4f668

Browse files
committed
docs(readme): docker compose hosting instructions
1 parent 420e95c commit 1b4f668

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

README.md

+31-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Pastebins are a type of online content storage service where users can store pla
4040
- [Documentation](#documentation)
4141
- [Self-hosting](#self-hosting)
4242
- [Using Docker](#using-docker)
43+
- [Docker Compose](#docker-compose)
4344
- [Manually](#manually)
4445
- [Environment Variables](#environment-variables)
4546
- [Database Connection URI](#database-connection-uri)
@@ -60,7 +61,36 @@ Pastebins are a type of online content storage service where users can store pla
6061
```sh
6162
# Pull and run docker image on port 80
6263
$ sudo docker pull spacebinorg/spirit
63-
$ sudo docker run -d -p 80:9000 spacebinorg/spirit
64+
$ sudo docker run -d -e SPIRIT_CONNECTION_URI="sqlite://database.sqlite" -p 80:9000 spacebinorg/spirit
65+
```
66+
67+
#### Docker Compose
68+
69+
Use the following config file to host Spacebin via Docker Compose:
70+
71+
```yml
72+
services:
73+
spacebin:
74+
image: spacebinorg/spirit:latest
75+
restart: always
76+
environment:
77+
- SPIRIT_CONNECTION_URI=postgres://spacebin:password@postgres:5432/spacebin?sslmode=disable
78+
ports:
79+
- 9000:9000
80+
depends_on:
81+
- postgres
82+
postgres:
83+
image: postgres:16.3-alpine
84+
restart: always
85+
environment:
86+
- POSTGRES_USER=spacebin
87+
- POSTGRES_PASSWORD=password
88+
- POSTGRES_DB=spacebin
89+
volumes:
90+
- postgres:/var/lib/postgresql/data
91+
92+
volumes:
93+
postgres:
6494
```
6595
6696
#### Manually

0 commit comments

Comments
 (0)