Skip to content

Commit

Permalink
Added missing docker files for port specific and network_mode: host -…
Browse files Browse the repository at this point in the history
… SQLite and Postgres (#556)

* Added missing docker files for port specific and network_mode: host - SQLite and Postgres

* combined all docker composes to 1 file & updated readme

* update info

* updated info
  • Loading branch information
hjongedijk authored Jul 23, 2024
1 parent 5f8d8c4 commit 59e0204
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 119 deletions.
68 changes: 13 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,48 +103,7 @@ services:
- /mnt:/mnt
```
docker-compose.yml (Frontend + Backend + SQLite)
```yml
---
services:
riven-frontend:
image: spoked/riven-frontend:latest
container_name: riven-frontend
restart: unless-stopped
network_mode: host
tty: true
environment:
- PUID=1000
- PGID=1000
- ORIGIN=http://localhost:3000
- BACKEND_URL=http://127.0.0.1:8080
- TZ=Europe/Amsterdam
depends_on:
riven:
condition: service_healthy

riven:
image: spoked/riven:latest
container_name: riven
restart: unless-stopped
network_mode: host
tty: true
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Amsterdam
- RIVEN_DATABASE_HOST=sqlite:////riven/data/media.db
healthcheck:
test: curl -s http://localhost:8080 >/dev/null || exit 1
interval: 30s
timeout: 10s
retries: 10
volumes:
- ./riven-data:/riven/data
- /mnt:/mnt
```
docker-compose.yml (Frontend + Backend + Postgres)
docker-compose.yml (Frontend + Backend + Postgress / SQLite + ports: / network_mode: host)
```yml
---
services:
Expand All @@ -154,29 +113,33 @@ services:
restart: unless-stopped
ports:
- "3000:3000"
#network_mode: host
tty: true
environment:
- PUID=1000
- PGID=1000
- ORIGIN=http://localhost:3000
- BACKEND_URL=http://127.0.0.1:8080
- TZ=Europe/Amsterdam
- TZ=America/New_York
depends_on:
riven:
condition: service_healthy

riven:
image: spoked/riven:latest
container_name: riven
restart: unless-stopped
ports:
- "8080:8080"
#network_mode: host
tty: true
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Amsterdam
- RIVEN_DATABASE_HOST=postgresql+psycopg2://postgres:postgres@riven_postgres/riven
- TZ=America/New_York
- RIVEN_DATABASE_HOST=postgresql+psycopg2://postgres:postgres@riven_postgres/riven #Postgres database
#- RIVEN_DATABASE_HOST=postgresql+psycopg2://postgres:postgres@localhost/riven #nework_mode: host {use @localhost}
#- RIVEN_DATABASE_HOST=sqlite:////riven/data/media.db #SQLite database
healthcheck:
test: curl -s http://localhost:8080 >/dev/null || exit 1
interval: 30s
Expand All @@ -185,11 +148,11 @@ services:
volumes:
- ./riven-data:/riven/data
- /mnt:/mnt
depends_on:
depends_on: # Add # before all {depend: riven_postgress} lines when using SQLite
riven_postgres:
condition: service_healthy

riven_postgres:
riven_postgres: # Add # before all {riven_postgres} lines when using SQLite
image: postgres:16.3-alpine3.20
container_name: riven-db
environment:
Expand All @@ -201,12 +164,7 @@ services:
interval: 30s
timeout: 10s
retries: 5
networks:
- postgres-internal

networks:
postgres-internal:
default:
#network_mode: host
```

Then run `docker compose up -d` to start the container in the background. You can then access the web interface at `http://localhost:3000` or whatever port and origin you set in the `docker-compose.yml` file.
Expand Down
54 changes: 0 additions & 54 deletions docker-compose-postgres-host.yml

This file was deleted.

52 changes: 42 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,60 @@
---
services:
riven-frontend:
image: spoked/riven-frontend:latest
container_name: riven-frontend
restart: unless-stopped
ports:
- "3000:3000"
#network_mode: host
tty: true
environment:
- PUID=1000
- PGID=1000
- ORIGIN=http://localhost:3000
- BACKEND_URL=http://127.0.0.1:8080
- TZ=America/New_York
depends_on:
riven:
condition: service_healthy

riven:
image: spoked/riven:latest
container_name: riven
restart: unless-stopped
ports:
- "8080:8080"
#network_mode: host
tty: true
environment:
- PUID=1000
- PGID=1000
- ORIGIN=http://localhost:3000
- BACKEND_URL=http://127.0.0.1:8080
- TZ=America/New_York
- RIVEN_DATABASE_HOST=postgresql+psycopg2://postgres:postgres@riven_postgres/riven
- RIVEN_DATABASE_HOST=postgresql+psycopg2://postgres:postgres@riven_postgres/riven #Postgres database
#- RIVEN_DATABASE_HOST=postgresql+psycopg2://postgres:postgres@localhost/riven #nework_mode: host {use @localhost}
#- RIVEN_DATABASE_HOST=sqlite:////riven/data/media.db #SQLite database
healthcheck:
test: curl -s http://localhost:8080 >/dev/null || exit 1
interval: 30s
timeout: 10s
retries: 10
volumes:
- ./data:/riven/data
- ./riven-data:/riven/data
- /mnt:/mnt
ports:
- "3000:3000"

riven_postgres:
depends_on: # Add # before all {depend: riven_postgress} lines when using SQLite
riven_postgres:
condition: service_healthy

riven_postgres: # Add # before all {riven_postgres} lines when using SQLite
image: postgres:16.3-alpine3.20
container_name: riven-db
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: riven
networks:
- postgres-internal
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 30s
timeout: 10s
retries: 5
#network_mode: host

0 comments on commit 59e0204

Please sign in to comment.