Skip to content

Commit 7f9391c

Browse files
committed
Added Docker compose documentation.
1 parent d3b151e commit 7f9391c

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,48 @@ Here is the current state of translation:
6868
3. Run `npm run start-container` to start the postgres and the spliit2 containers
6969
4. You can access the app by browsing to http://localhost:3000
7070

71+
## Run with Docker compose
72+
73+
This is a sample `docker-compose.yml` file that you can use to deploy this web app.
74+
75+
```yaml
76+
name: spliit
77+
78+
services:
79+
app:
80+
image: ghcr.io/spliit-app/spliit:latest
81+
user: "1000:1000" # change to your user id or remove if you want root
82+
ports:
83+
- "80:3000/tcp"
84+
environment:
85+
POSTGRES_PRISMA_URL: postgresql://spliit:spliit@database:5432/spliit
86+
POSTGRES_URL_NON_POOLING: postgresql://spliit:spliit@database:5432/spliit
87+
volumes:
88+
- ./app/cache:/usr/app/.next/cache
89+
depends_on:
90+
- database
91+
networks:
92+
- spliit
93+
94+
database:
95+
image: postgres:17.3
96+
user: "1000:1000"
97+
environment:
98+
POSTGRES_USER: spliit
99+
POSTGRES_PASSWORD: spliit
100+
POSTGRES_DB: spliit
101+
volumes:
102+
- ./database/data:/var/lib/postgresql/data
103+
networks:
104+
- spliit
105+
106+
networks:
107+
spliit:
108+
```
109+
110+
You can use named volumes in place of bind mounts if you prefer not having
111+
data stored inside local directories.
112+
71113
## Health check
72114
73115
The application has a health check endpoint that can be used to check if the application is running and if the database is accessible.

0 commit comments

Comments
 (0)