Skip to content

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

Bugfix/fix docker compose files to resolve variables correctly (#983)

Thomas Kaul14a0eeab2919
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 39b91d8333..6a986f88c5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Restructured the _FIRE_ section
- Upgraded `@simplewebauthn/browser` and `@simplewebauthn/server` from version `4.1.0` to `5.2.1`
+### Fixed
+
+- Fixed the `docker-compose` files to resolve variables correctly
+
## 1.155.0 - 29.05.2022
### Added
diff --git a/README.md b/README.md
index f29693e7ec..545d9d6b3e 100644
--- a/README.md
+++ b/README.md
@@ -91,7 +91,7 @@ The frontend is built with [Angular](https://angular.io) and uses [Angular Mater
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.yml up -d
+docker-compose --env-file ./.env -f docker/docker-compose.yml up -d
```
#### Setup Database
@@ -99,7 +99,7 @@ docker-compose -f docker/docker-compose.yml up -d
Run the following command to setup the database once Ghostfolio is running:
```bash
-docker-compose -f docker/docker-compose.yml exec ghostfolio yarn database:setup
+docker-compose --env-file ./.env -f docker/docker-compose.yml exec ghostfolio yarn database:setup
```
### b. Build and run environment
@@ -107,8 +107,8 @@ docker-compose -f docker/docker-compose.yml exec ghostfolio yarn database:setup
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 -d
+docker-compose --env-file ./.env -f docker/docker-compose.build.yml build
+docker-compose --env-file ./.env -f docker/docker-compose.build.yml up -d
```
#### Setup Database
@@ -116,7 +116,7 @@ docker-compose -f docker/docker-compose.build.yml up -d
Run the following command to setup the database once Ghostfolio is running:
```bash
-docker-compose -f docker/docker-compose.build.yml exec ghostfolio yarn database:setup
+docker-compose --env-file ./.env -f docker/docker-compose.build.yml exec ghostfolio yarn database:setup
```
### Fetch Historical Data
@@ -130,8 +130,8 @@ Open http://localhost:3333 in your browser and accomplish these steps:
### Upgrade Version
1. Increase the version of the `ghostfolio/ghostfolio` Docker image in `docker/docker-compose.yml`
-1. Run the following command to start the new Docker image: `docker-compose -f docker/docker-compose.yml up -d`
-1. Then, run the following command to keep your database schema in sync: `docker-compose -f docker/docker-compose.yml exec ghostfolio yarn database:migrate`
+1. Run the following command to start the new Docker image: `docker-compose --env-file ./.env -f docker/docker-compose.yml up -d`
+1. Then, run the following command to keep your database schema in sync: `docker-compose --env-file ./.env -f docker/docker-compose.yml exec ghostfolio yarn database:migrate`
## Run with _Unraid_ (self-hosting)
@@ -149,7 +149,7 @@ Please follow the instructions of the Ghostfolio [Unraid Community App](https://
### Setup
1. Run `yarn install`
-1. Run `docker-compose -f docker/docker-compose.dev.yml up -d` to start [PostgreSQL](https://www.postgresql.org) and [Redis](https://redis.io)
+1. Run `docker-compose --env-file ./.env -f docker/docker-compose.dev.yml up -d` to start [PostgreSQL](https://www.postgresql.org) and [Redis](https://redis.io)
1. Run `yarn database:setup` to initialize the database schema and populate your database with (example) data
1. Start the server and the client (see [_Development_](#Development))
1. Create a new user via _Get Started_ (this first user will get the role `ADMIN`)
diff --git a/docker/docker-compose.build.yml b/docker/docker-compose.build.yml
index 37f63d8c8e..82fccad8b7 100644
--- a/docker/docker-compose.build.yml
+++ b/docker/docker-compose.build.yml
@@ -5,7 +5,7 @@ services:
env_file:
- ../.env
environment:
- DATABASE_URL: postgresql://user:password@postgres:5432/ghostfolio-db?sslmode=prefer
+ DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=prefer
REDIS_HOST: 'redis'
REDIS_PASSWORD: ${REDIS_PASSWORD}
ports:
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index 786f62f556..c94954b3ee 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -5,7 +5,7 @@ services:
env_file:
- ../.env
environment:
- DATABASE_URL: postgresql://user:password@postgres:5432/ghostfolio-db?sslmode=prefer
+ DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=prefer
REDIS_HOST: 'redis'
REDIS_PASSWORD: ${REDIS_PASSWORD}
ports: