Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 000c459d76 | |||
| 307f65c898 | |||
| 5db54adfb7 | |||
| 19fb9a85fc | |||
| 9d48ebbad9 | |||
| 077b5257e8 | |||
| b84602a5ed | |||
| 43541c1af2 | |||
| 8c4d0fa1a1 | |||
| 16fed7a8ca | |||
| c1009a19fb | |||
| be189cf899 | |||
| 8116d1d4de | |||
| ab698c8903 | |||
| 74b16f2165 | |||
| fafbbe9b3a | |||
| 04b32c3f33 | |||
| 0babcbfac4 | |||
| 2da57d95b7 | |||
| d317c03819 | |||
| 2e187b5e08 | |||
| 064343c1ff | |||
| efc67c63d8 | |||
| a978377501 | |||
| 1bf05a1b87 | |||
| 5e3c993a15 | |||
| 4220bb629f |
@@ -8,8 +8,11 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04 #ubuntu-latest
|
||||
steps:
|
||||
- name: Increase swap space
|
||||
run: sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=5120 && sudo chmod 600 /var/swap.1 && sudo /sbin/mkswap /var/swap.1 && sudo /sbin/swapon /var/swap.1
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
@@ -29,6 +32,14 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-
|
||||
|
||||
- name: Extract version from tag
|
||||
id: extract-version
|
||||
run: |
|
||||
@@ -44,6 +55,4 @@ jobs:
|
||||
investbrainapp/investbrain:latest
|
||||
investbrainapp/investbrain:${{ env.version }}
|
||||
ghcr.io/investbrainapp/investbrain:latest
|
||||
ghcr.io/investbrainapp/investbrain:${{ env.version }}
|
||||
|
||||
|
||||
ghcr.io/investbrainapp/investbrain:${{ env.version }}
|
||||
@@ -44,15 +44,15 @@ Grab a copy of the [docker-compose.yml](https://github.com/investbrainapp/invest
|
||||
|
||||
**2. Set your environment**
|
||||
|
||||
Adjust the `environment` properties in the Docker Compose file to your preferences.
|
||||
Adjust the `environment` properties in the Docker Compose file to your preferences. Alternatively, create a .env file in the same directory as your compose file, then reference the .env file using the `env_file` property.
|
||||
|
||||
_Particularly_, you need to set the `APP_KEY` value to a complex random value. If you're unsure, you can run `openssl rand -base64 32` from your terminal to generate a strong application key.
|
||||
_Importantly_, you need to set the `APP_KEY` value to a complex random value. If you're unsure, Investbrain will generate an `APP_KEY` for you on first run - but you must **manually** update your environment configuration with this generated value!
|
||||
|
||||
> Tip: Want to know what options are available? You can reference the [.env.example](https://github.com/investbrainapp/investbrain/blob/main/.env.example) file in this respository for available environment configurations.
|
||||
> Tip: Want to know what other configuration options are available? You can reference the [.env.example](https://github.com/investbrainapp/investbrain/blob/main/.env.example) file in this respository for available environment configurations.
|
||||
|
||||
**3. Run `docker compose up`**
|
||||
|
||||
This might take a few minutes. But if everything worked as expected, you should now be able to access Investbrain in the browser by visiting:
|
||||
This might take a few minutes to pull the Docker images. But assuming everything worked as expected, you should now be able to access Investbrain in the browser by visiting:
|
||||
|
||||
```bash
|
||||
http://localhost:8000/register
|
||||
@@ -76,7 +76,7 @@ Investbrain includes an extensible market data provider interface that allows yo
|
||||
|
||||
### Configuration
|
||||
|
||||
You can specify the market data provider you want to use in your .env file:
|
||||
You can specify the market data provider you want to use in your environment variables:
|
||||
|
||||
```bash
|
||||
MARKET_DATA_PROVIDER=yahoo
|
||||
@@ -84,7 +84,7 @@ MARKET_DATA_PROVIDER=yahoo
|
||||
|
||||
You can also use Investbrain's built-in fallback mechanism to ensure reliable data access. If any provider fails, Investbrain will automatically attempt to retrieve data from the next available provider, continuing through your configured providers until one returns successfully.
|
||||
|
||||
Your selected providers should be listed in your .env file. Each should be separated by a comma:
|
||||
Your selected providers should be listed in your environment variables. Each should be separated by a comma:
|
||||
|
||||
```bash
|
||||
MARKET_DATA_PROVIDER=yahoo,alphavantage
|
||||
@@ -129,7 +129,7 @@ Exporting your portfolios and transactions is a convenient way to back-up your I
|
||||
|
||||
## Configuration
|
||||
|
||||
There are several optional configurations available when installing using the recommended [Docker method](#self-hosting). These options are configurable using an environment file. Changes can be made in your [.env](https://github.com/investbrainapp/investbrain/blob/main/.env.example) file before installation.
|
||||
There are several optional configurations available when installing using the recommended [Docker method](#self-hosting). These options are configurable using an environment file. Configurations can be added to your [.env](https://github.com/investbrainapp/investbrain/blob/main/.env.example) file or to the `environment` property in the [docker-compose.yml](https://github.com/investbrainapp/investbrain/blob/main/docker-compose.yml) file.
|
||||
|
||||
| Option | Description | Default |
|
||||
| ------------- | ------------- | ------------- |
|
||||
@@ -150,7 +150,7 @@ There are several optional configurations available when installing using the re
|
||||
| REGISTRATION_ENABLED | Whether to enable registration of new users | `true` |
|
||||
|
||||
|
||||
> Note: These options affect the [docker-compose.yml](https://github.com/investbrainapp/investbrain/blob/main/docker-compose.yml) file and are cached during run-time. If change any .env values, you'll have to restart the containers before your changes take effect.
|
||||
> Note: These options affect the [docker-compose.yml](https://github.com/investbrainapp/investbrain/blob/main/docker-compose.yml) file and are cached during run-time. If change any environment configurations, you'll have to restart the container before your changes take effect.
|
||||
|
||||
## Updating
|
||||
|
||||
@@ -160,10 +160,10 @@ To update Investbrain using the recommended [Docker installation](#self-hosting)
|
||||
docker compose stop
|
||||
```
|
||||
|
||||
Then pull the latest updates from this repository using git:
|
||||
Then pull the latest Docker image:
|
||||
|
||||
```bash
|
||||
git pull
|
||||
docker image pull investbrainapp/investbrain:latest
|
||||
```
|
||||
|
||||
Finally bring the containers back up!
|
||||
|
||||
+13
-13
@@ -10,19 +10,19 @@ services:
|
||||
ports:
|
||||
- "${APP_PORT:-8000}:80"
|
||||
environment:
|
||||
- APP_KEY= # Generate a key using `openssl rand -base64 32`
|
||||
- APP_URL="http://localhost:8000"
|
||||
- ASSET_URL="http://localhost:8000"
|
||||
- DB_CONNECTION=mysql
|
||||
- DB_HOST=investbrain-mysql
|
||||
- DB_PORT=3306
|
||||
- DB_DATABASE=investbrain
|
||||
- DB_USERNAME=investbrain
|
||||
- DB_PASSWORD=investbrain
|
||||
- SESSION_DRIVER=redis
|
||||
- QUEUE_CONNECTION=redis
|
||||
- CACHE_STORE=redis
|
||||
- REDIS_HOST=investbrain-redis
|
||||
APP_KEY: "" # Generate a key using `openssl rand -base64 32`
|
||||
APP_URL: "http://localhost:8000"
|
||||
ASSET_URL: "http://localhost:8000"
|
||||
DB_CONNECTION: mysql
|
||||
DB_HOST: investbrain-mysql
|
||||
DB_PORT: 3306
|
||||
DB_DATABASE: ${DB_DATABASE:-investbrain}
|
||||
DB_USERNAME: ${DB_USERNAME:-investbrain}
|
||||
DB_PASSWORD: ${DB_PASSWORD:-investbrain}
|
||||
SESSION_DRIVER: redis
|
||||
QUEUE_CONNECTION: redis
|
||||
CACHE_STORE: redis
|
||||
REDIS_HOST: investbrain-redis
|
||||
volumes:
|
||||
- ./storage:/var/www/app/storage:delegated
|
||||
depends_on:
|
||||
|
||||
+18
-17
@@ -10,8 +10,12 @@ ENV SELF_HOSTED=true
|
||||
COPY . /var/www/app
|
||||
WORKDIR /var/www/app
|
||||
|
||||
# Install common php extension dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
# Allow PHP installs to be built cross-platform
|
||||
#ENV CFLAGS="-fstack-protector-strong -fpic -fPIC -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
|
||||
|
||||
# Install required packages
|
||||
RUN apt-get update && apt-get upgrade -y \
|
||||
&& apt-get upgrade -y \
|
||||
nginx \
|
||||
libfreetype-dev \
|
||||
libjpeg62-turbo-dev \
|
||||
@@ -20,13 +24,18 @@ RUN apt-get update && apt-get install -y \
|
||||
libzip-dev \
|
||||
libicu-dev \
|
||||
libpq-dev \
|
||||
binutils libc6-dev \
|
||||
supervisor \
|
||||
unzip curl git \
|
||||
nodejs npm \
|
||||
# Clean up APT
|
||||
&& apt-get -y autoremove \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
|
||||
# Install PHP extensions
|
||||
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||
&& docker-php-ext-install -j$(nproc) \
|
||||
gd pgsql bcmath zip pdo_mysql mysqli intl \
|
||||
&& apt-get -y autoremove \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
gd pgsql zip pdo_mysql mysqli intl
|
||||
|
||||
# Set permissions
|
||||
RUN chown -R www-data:www-data . \
|
||||
@@ -34,17 +43,9 @@ RUN chown -R www-data:www-data . \
|
||||
&& chmod +x ./docker/entrypoint.sh \
|
||||
&& usermod -s /bin/bash www-data
|
||||
|
||||
# Install Composer and Node.js
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
unzip \
|
||||
git \
|
||||
nodejs \
|
||||
npm \
|
||||
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||
|
||||
# Install PHP dependencies and build front end assets
|
||||
RUN composer install --no-scripts --optimize-autoloader \
|
||||
# Install Composer and Node.js Install PHP dependencies and build front end assets
|
||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
|
||||
&& composer install --no-scripts --optimize-autoloader \
|
||||
&& npm install && npm run build
|
||||
|
||||
# Remove default nginx config
|
||||
|
||||
Reference in New Issue
Block a user