Compare commits

...

27 Commits

Author SHA1 Message Date
hackerESQ 000c459d76 Merge pull request #55 from investbrainapp/optimize-dockerfile
workflow: Downgrade github runner to Ubunutu 22.04
2025-01-27 15:20:52 -06:00
hackerESQ 307f65c898 Merge branch 'main' into optimize-dockerfile 2025-01-27 15:20:46 -06:00
hackerESQ 5db54adfb7 cleanup 2025-01-27 15:16:01 -06:00
hackerESQ 19fb9a85fc cleanup 2025-01-27 14:26:40 -06:00
hackerESQ 9d48ebbad9 downgrade 2025-01-27 14:26:27 -06:00
hackerESQ 077b5257e8 swap 2025-01-27 14:02:28 -06:00
hackerESQ b84602a5ed swap 2025-01-27 13:59:03 -06:00
hackerESQ 43541c1af2 swap 2025-01-27 13:57:30 -06:00
hackerESQ 8c4d0fa1a1 merge 2025-01-27 13:23:00 -06:00
hackerESQ 16fed7a8ca add flags 2025-01-27 13:03:13 -06:00
hackerESQ c1009a19fb wip 2025-01-27 12:48:16 -06:00
hackerESQ be189cf899 typo 2025-01-27 12:01:14 -06:00
hackerESQ 8116d1d4de try sury package no buikd 2025-01-27 11:55:18 -06:00
hackerESQ ab698c8903 add fpic support for multi arch 2025-01-27 11:33:45 -06:00
hackerESQ 74b16f2165 streamline 2025-01-27 11:06:58 -06:00
hackerESQ fafbbe9b3a back to ubuntu (has docker preinstalled) 2025-01-27 10:51:31 -06:00
hackerESQ 04b32c3f33 try mac for github action 2025-01-27 10:49:24 -06:00
hackerESQ 0babcbfac4 update readme 2025-01-27 08:23:47 -06:00
hackerESQ 2da57d95b7 add pgsql back 2025-01-26 23:48:24 -06:00
hackerESQ d317c03819 Merge pull request #54 from investbrainapp/optimize-dockerfile
Optimize dockerfile
2025-01-26 23:40:16 -06:00
hackerESQ 2e187b5e08 rmeove pgsql 2025-01-26 23:39:30 -06:00
hackerESQ 064343c1ff Update build-and-push-images.yml 2025-01-26 23:25:31 -06:00
hackerESQ efc67c63d8 Update build-and-push-images.yml 2025-01-26 23:22:46 -06:00
hackerESQ a978377501 Update build-and-push-images.yml 2025-01-26 23:20:40 -06:00
hackerESQ 1bf05a1b87 use default vars for db config 2025-01-26 23:02:40 -06:00
hackerESQ 5e3c993a15 Merge pull request #53 from investbrainapp/optimize-dockerfile
Remove bcmath
2025-01-26 22:57:13 -06:00
hackerESQ 4220bb629f remove bcmath 2025-01-26 22:56:41 -06:00
4 changed files with 54 additions and 44 deletions
+13 -4
View File
@@ -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 }}
+10 -10
View File
@@ -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
View File
@@ -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
View File
@@ -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