Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Feature/extend documentation for self hosting (#565)

Thomas Kauled1136999a51
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 82c20733c2..5f4e591e46 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Added support for cryptocurrency _Solana_ (`SOL-USD`)
+- Extended the documentation for self-hosting with the [official Ghostfolio Docker image](https://hub.docker.com/r/ghostfolio/ghostfolio)
### Fixed
diff --git a/README.md b/README.md
index 03f8dc8a2f..653deec6ac 100644
--- a/README.md
+++ b/README.md
@@ -81,19 +81,27 @@ The backend is based on [NestJS](https://nestjs.com) using [PostgreSQL](https://
The frontend is built with [Angular](https://angular.io) and uses [Angular Material](https://material.angular.io) with utility classes from [Bootstrap](https://getbootstrap.com).
-## Run with Docker
+## Run with Docker (self-hosting)
### Prerequisites
- [Docker](https://www.docker.com/products/docker-desktop)
-### Setup Docker Image
+### a. Run environment
-Run the following commands to build and start the Docker image:
+Run the following command to start the Docker images from [Docker Hub](https://hub.docker.com/r/ghostfolio/ghostfolio):
```bash
-docker-compose -f docker/docker-compose-build-local.yml build
-docker-compose -f docker/docker-compose-build-local.yml up
+docker-compose -f docker/docker-compose.yml up
+```
+
+### b. Build and run environment
+
+Run the following commands to build and start the Docker images:
+
+```bash
+docker-compose -f docker/docker-compose.build.yml build
+docker-compose -f docker/docker-compose.build.yml up
```
### Setup Database
@@ -112,6 +120,12 @@ Open http://localhost:3333 in your browser and accomplish these steps:
1. Go to the _Admin Control Panel_ and click _Gather All Data_ to fetch historical data
1. Click _Sign out_ and check out the _Live Demo_
+### Finalization
+
+1. Create a new user via _Get Started_
+1. Assign the role `ADMIN` to this user (directly in the database)
+1. Delete the original _Admin_ (directly in the database)
+
### Migrate Database
With the following command you can keep your database schema in sync after a Ghostfolio version update:
diff --git a/docker/docker-compose-build-local.yml b/docker/docker-compose.build.yml
similarity index 100%
rename from docker/docker-compose-build-local.yml
rename to docker/docker-compose.build.yml
index 39d6fcf955..1d2496f9bf 100644
--- a/docker/docker-compose-build-local.yml
+++ b/docker/docker-compose.build.yml
@@ -1,5 +1,15 @@
version: '3.7'
services:
+ ghostfolio:
+ build: ../
+ env_file:
+ - ../.env
+ environment:
+ DATABASE_URL: postgresql://user:password@postgres:5432/ghostfolio-db?sslmode=prefer
+ REDIS_HOST: 'redis'
+ ports:
+ - 3333:3333
+
postgres:
image: postgres:12
env_file:
@@ -10,15 +20,5 @@ services:
redis:
image: 'redis:alpine'
- ghostfolio:
- build: ../
- env_file:
- - ../.env
- environment:
- REDIS_HOST: 'redis'
- DATABASE_URL: postgresql://user:password@postgres:5432/ghostfolio-db?sslmode=prefer
- ports:
- - 3333:3333
-
volumes:
postgres:
diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml
new file mode 100644
index 0000000000..8e5a8ec07e
--- /dev/null
+++ b/docker/docker-compose.dev.yml
@@ -0,0 +1,22 @@
+version: '3.7'
+services:
+ postgres:
+ image: postgres:12
+ container_name: postgres
+ restart: unless-stopped
+ ports:
+ - 5432:5432
+ env_file:
+ - ../.env
+ volumes:
+ - postgres:/var/lib/postgresql/data
+
+ redis:
+ image: 'redis:alpine'
+ container_name: redis
+ restart: unless-stopped
+ ports:
+ - 6379:6379
+
+volumes:
+ postgres:
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index 8e5a8ec07e..7c260f3cd2 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -1,11 +1,17 @@
version: '3.7'
services:
+ ghostfolio:
+ image: ghostfolio/ghostfolio
+ env_file:
+ - ../.env
+ environment:
+ DATABASE_URL: postgresql://user:password@postgres:5432/ghostfolio-db?sslmode=prefer
+ REDIS_HOST: 'redis'
+ ports:
+ - 3333:3333
+
postgres:
image: postgres:12
- container_name: postgres
- restart: unless-stopped
- ports:
- - 5432:5432
env_file:
- ../.env
volumes:
@@ -13,10 +19,6 @@ services:
redis:
image: 'redis:alpine'
- container_name: redis
- restart: unless-stopped
- ports:
- - 6379:6379
volumes:
postgres:
diff --git a/publish-docker-image.sh b/publish-docker-image.sh
index 310ffb49b6..b554f67148 100755
--- a/publish-docker-image.sh
+++ b/publish-docker-image.sh
@@ -1,5 +1,5 @@
set -xe
echo "$DOCKER_HUB_ACCESS_TOKEN" | docker login -u "$DOCKER_HUB_USERNAME" --password-stdin
-docker build -t ghostfolio/ghostfolio:$TRAVIS_TAG .
-docker push ghostfolio/ghostfolio:$TRAVIS_TAG
+docker build -t ghostfolio/ghostfolio:$TRAVIS_TAG -t ghostfolio/ghostfolio:latest .
+docker push ghostfolio/ghostfolio --all-tags