preparing arch change for extensions implementation

This commit is contained in:
Ronald A. Richardson
2024-07-18 01:48:55 +08:00
parent b06830990c
commit 579a369888
8 changed files with 63 additions and 33 deletions

View File

@@ -13,15 +13,15 @@ We use github to host code, to track issues and feature requests, as well as acc
## We Use [Github Flow](https://guides.github.com/introduction/flow/index.html), So All Code Changes Happen Through Pull Requests
Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://guides.github.com/introduction/flow/index.html)). We actively welcome your pull requests:
1. Fork the repo and create your branch from `master`.
1. Fork the repo and create your branch from `main`.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
5. Make sure your code lints.
6. Issue that pull request!
## Any contributions you make will be under the MIT Software License
In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern.
## Any contributions you make will be under the AGPL v3 Software License
In short, when you submit code changes, your submissions are understood to be under the same [AGPL v3](https://choosealicense.com/licenses/agpl-3.0/) that covers the project. Feel free to contact the maintainers if that's a concern.
## Report bugs using Github's [issues](https://github.com/fleetbase/fleetbase/issues)
We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/fleetbase/fleetbase/issues), it's that easy!
@@ -41,7 +41,7 @@ We use GitHub issues to track public bugs. Report a bug by [opening a new issue]
People *love* thorough bug reports. I'm not even kidding.
## License
By contributing, you agree that your contributions will be licensed under its MIT License.
By contributing, you agree that your contributions will be licensed under its AGPL v3 Software License.
## References
This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md)

View File

@@ -10,3 +10,10 @@ http://:8000 {
resolve_root_symlink
}
}
http://:4201 {
root * /fleetbase/console/dist
try_files {path} /
encode zstd gzip
file_server
}

View File

@@ -1,17 +1,8 @@
import loadExtensions from '@fleetbase/ember-core/utils/load-extensions';
export function initialize(owner) {
export function initialize (owner) {
const universe = owner.lookup('service:universe');
loadExtensions().then((extensions) => {
extensions.forEach((extension) => {
universe.loadEngine(extension.name).then((engineInstance) => {
if (engineInstance.base && engineInstance.base.setupExtension) {
engineInstance.base.setupExtension(owner, engineInstance, universe);
}
});
});
});
if (universe) {
universe.bootEngines(owner);
}
}
export default {

View File

@@ -40,6 +40,10 @@ module.exports = function (environment) {
port: getenv('SOCKETCLUSTER_PORT', 38000),
},
stripe: {
publishableKey: getenv('STRIPE_KEY')
},
defaultValues: {
categoryImage: getenv('DEFAULT_CATEGORY_IMAGE', 'https://flb-assets.s3.ap-southeast-1.amazonaws.com/images/fallback-placeholder-1.png'),
placeholderImage: getenv('DEFAULT_PLACEHOLDER_IMAGE', 'https://flb-assets.s3.ap-southeast-1.amazonaws.com/images/fallback-placeholder-2.png'),

View File

@@ -38,18 +38,9 @@ services:
CACHE_URL: tcp://cache
REDIS_URL: tcp://cache
console:
ports:
- "4200:4200"
volumes:
- ./console:/app/console
build:
context: .
dockerfile: console/Dockerfile
args:
ENVIRONMENT: development
application:
ports:
- "4201:4201"
build:
context: .
dockerfile: docker/Dockerfile

View File

@@ -3,7 +3,7 @@
FROM dunglas/frankenphp:1.1.0-php8.2-bookworm as base
# Install packages
RUN apt-get update && apt-get install -y git bind9-utils mycli nodejs npm \
RUN apt-get update && apt-get install -y git bind9-utils mycli nodejs npm nano \
&& mkdir -p /root/.ssh \
&& ssh-keyscan github.com >> /root/.ssh/known_hosts
@@ -31,17 +31,25 @@ RUN sed -e 's/^expose_php.*/expose_php = Off/' "$PHP_INI_DIR/php.ini-production"
-e 's/^memory_limit.*/memory_limit = 600M/' "$PHP_INI_DIR/php.ini"
# Install global node modules
RUN npm install -g chokidar
RUN npm install -g chokidar ember-cli pnpm
# Install ssm-parent
COPY --from=ghcr.io/springload/ssm-parent:1.8 /usr/bin/ssm-parent /sbin/ssm-parent
# # Create the pnpm directory and set the PNPM_HOME environment variable
# RUN mkdir -p ~/.pnpm
# ENV PNPM_HOME /root/.pnpm
# # Add the pnpm global bin to the PATH
# ENV PATH /root/.pnpm/bin:$PATH
# Set some build ENV variables
ENV LOG_CHANNEL=stdout
ENV CACHE_DRIVER=null
ENV BROADCAST_DRIVER=socketcluster
ENV QUEUE_CONNECTION=redis
ENV CADDYFILE_PATH=/fleetbase/Caddyfile
ENV CONSOLE_PATH=/fleetbase/console
ENV OCTANE_SERVER=frankenphp
# Set environment
@@ -57,17 +65,46 @@ COPY --chown=www-data:www-data ./Caddyfile $CADDYFILE_PATH
# Create /fleetbase directory and set correct permissions
RUN mkdir -p /fleetbase/api && chown -R www-data:www-data /fleetbase
## -- Start Console Setup --
# Set working directory
WORKDIR /fleetbase/console
# TEMPORARILY ADD REGISTRY BRIDGE AND CORE API
COPY ./packages/registry-bridge /fleetbase/packages/registry-bridge
COPY ./packages/core-api /fleetbase/packages/core-api
# Copy pnpm-lock.yaml (or package.json) into the directory /app in the container
COPY ./console/package.json ./console/pnpm-lock.yaml /fleetbase/console/
# Copy over .npmrc if applicable
COPY ./console/.npmr[c] /fleetbase/console/
# Install app dependencies
# RUN pnpm install
# Copy the console directory contents into the container at /app
COPY ./console /fleetbase/console/
# Build the application
# RUN pnpm build --environment $ENVIRONMENT
## -- End Console Setup --
# Set working directory
WORKDIR /fleetbase/api
# If GITHUB_AUTH_KEY is provided, create auth.json with it
RUN if [ -n "$GITHUB_AUTH_KEY" ]; then echo "{\"github-oauth\": {\"github.com\": \"$GITHUB_AUTH_KEY\"}}" > auth.json; fi
# Prepare composer cache directory
RUN mkdir -p /var/www/.cache/composer && chown -R www-data:www-data /var/www/.cache/composer
# Optimize Composer Dependency Installation
COPY --chown=www-data:www-data ./api/composer.json ./api/composer.lock /fleetbase/api/
# Pre-install Composer dependencies
RUN su www-data -s /bin/sh -c "composer install --no-scripts --optimize-autoloader --no-dev"
RUN su www-data -s /bin/sh -c "composer install --no-scripts --optimize-autoloader --no-dev --no-cache"
# Setup application
COPY --chown=www-data:www-data ./api /fleetbase/api