Compare commits

...

25 Commits

Author SHA1 Message Date
Ron
04bdb52c08 Merge pull request #284 from fleetbase/dev-v0.5.3
Upgraded Registry Bridge to v0.0.11
2024-07-31 16:42:17 +07:00
Ronald A. Richardson
8e5a45dd09 Upgraded Registry Bridge to v0.0.11 2024-07-31 17:24:01 +08:00
Ron
196af155ae Merge pull request #283 from fleetbase/dev-v0.5.2
v0.5.2
2024-07-30 21:46:10 +07:00
Ronald A. Richardson
056a717d08 changed default osrm server to project-osrm router, added admin bypass for email verification, patched somethings in registry-bridge, added new UI wysiwyg component <TipTapEditor /> 2024-07-30 22:39:57 +08:00
Ronald A. Richardson
fd008d7f73 hotfix cd for putting extensions in env config 2024-07-25 19:05:34 +08:00
Ron
451c95d0f0 Merge pull request #277 from fleetbase/dev-v0.5.1
v0.5.1
2024-07-25 17:33:52 +07:00
Ronald A. Richardson
b267b303cf fix console depnds 2024-07-25 18:17:36 +08:00
Ronald A. Richardson
441b4f3f0c Extension boot patches, dependency upgrades, performance upgrades 2024-07-25 18:14:11 +08:00
Ronald A. Richardson
0e4d4a7c8c ability to provide installed extensions via environment config 2024-07-23 17:05:35 +08:00
Ronald A. Richardson
24392527e0 fix cd workflow, upgrade node 18x and pnpm 9x 2024-07-23 12:42:16 +08:00
Ronald A. Richardson
c19d838757 hotfix Dockerfile for deployments 2024-07-23 10:45:39 +08:00
Ron
3a072c1524 Merge pull request #264 from fleetbase/feature/extensions-registry
feature/extensions-registry
2024-07-23 08:48:45 +07:00
Ronald A. Richardson
0c96386cf1 few tweaks to cicd, and fix in Dockerfile 2024-07-22 16:19:07 +08:00
Ronald A. Richardson
708babb81c fix ports on docker-compose 2024-07-22 14:19:11 +08:00
Ronald A. Richardson
8c8acf1e43 docker changes 2024-07-22 14:10:56 +08:00
Ronald A. Richardson
e853e2ca22 set new registry to composer 2024-07-20 10:41:35 +08:00
Ronald A. Richardson
dacaff37ca bump version to 0.5.0 2024-07-19 20:21:47 +08:00
Ronald A. Richardson
b0460963e5 added console back to docker-compose 2024-07-19 20:15:54 +08:00
Ronald A. Richardson
9ec786d892 almost ready for release, pending updates to registry... 2024-07-19 20:14:12 +08:00
Ronald A. Richardson
76859aeb26 almost ready for release of extensions 2024-07-19 18:09:14 +08:00
Ronald A. Richardson
1764b804de remove unnecessary utils and components 2024-07-18 02:05:19 +08:00
Ronald A. Richardson
0c33018b5b wip 2024-07-18 02:02:23 +08:00
Ronald A. Richardson
72b1b9b764 Merge branch 'feature/extensions-registry' of github.com:fleetbase/fleetbase into feature/extensions-registry 2024-07-18 01:58:43 +08:00
Ronald A. Richardson
aee552f518 remove extension template 2024-07-18 01:58:13 +08:00
Ron
9967f27c83 Merge pull request #276 from fleetbase/feature-registry-extension-updates
Feature registry extension updates
2024-07-18 00:50:27 +07:00
34 changed files with 15100 additions and 11705 deletions

View File

@@ -109,13 +109,13 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 8
version: 9.5.0
run_install: false
- name: Get pnpm Store Directory
@@ -139,6 +139,20 @@ jobs:
fi
working-directory: ./console
- name: Set Env Variables for QA
if: startsWith(github.ref, 'refs/heads/deploy/qa')
run: |
echo "STRIPE_KEY=${{ secrets.STRIPE_TEST_KEY }}" >> ./environments/.env.production
echo "EXTENSIONS=@fleetbase/billing-engine,@fleetbase/internals-engine" >> ./environments/.env.production
working-directory: ./console
- name: Set Env Variables for Production
if: startsWith(github.ref, 'refs/heads/deploy/production')
run: |
echo "STRIPE_KEY=${{ secrets.STRIPE_KEY }}" >> ./environments/.env.production
echo "EXTENSIONS=@fleetbase/billing-engine,@fleetbase/internals-engine" >> ./environments/.env.production
working-directory: ./console
- name: Install dependencies
run: pnpm install
working-directory: ./console

6
.gitmodules vendored
View File

@@ -36,3 +36,9 @@
[submodule "docs"]
path = docs
url = git@github.com:fleetbase/docs.git
[submodule "packages/registry-bridge"]
path = packages/registry-bridge
url = git@github.com:fleetbase/registry-bridge.git
[submodule "packages/ledger"]
path = packages/ledger
url = git@github.com:fleetbase/ledger.git

View File

@@ -1,19 +1,14 @@
{
frankenphp
frankenphp {
num_threads 24
}
order php_server before file_server
}
http://:8000 {
root * /fleetbase/api/public
encode zstd gzip
encode zstd br gzip
php_server {
resolve_root_symlink
}
}
http://:4201 {
root * /fleetbase/console/dist
try_files {path} /
encode zstd gzip
file_server
}
}

19
Caddyfile.console Normal file
View File

@@ -0,0 +1,19 @@
{
frankenphp
order php_server before file_server
}
http://:8000 {
root * /fleetbase/api/public
encode zstd gzip
php_server {
resolve_root_symlink
}
}
http://:4200 {
root * /fleetbase/console/dist
try_files {path} /
encode zstd gzip
file_server
}

View File

@@ -9,9 +9,10 @@
"license": "AGPL-3.0-or-later",
"require": {
"php": "^8.0",
"fleetbase/core-api": "^1.4.27",
"fleetbase/fleetops-api": "^0.5.3",
"fleetbase/storefront-api": "^0.3.12",
"fleetbase/core-api": "^1.5.1",
"fleetbase/fleetops-api": "^0.5.5",
"fleetbase/registry-bridge": "^0.0.11",
"fleetbase/storefront-api": "^0.3.13",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^10.0",
"laravel/octane": "^2.3",
@@ -36,6 +37,10 @@
{
"type": "vcs",
"url": "https://github.com/fleetbase/laravel-model-caching"
},
{
"type": "composer",
"url": "https://registry.fleetbase.io"
}
],
"autoload": {

843
api/composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -23,3 +23,6 @@ php artisan schedule-monitor:sync
# Clear cache
php artisan cache:clear
# Initialize registry
php artisan registry:init

View File

@@ -0,0 +1,54 @@
# ---- Build Stage ----
FROM node:18.15.0-alpine as builder
# Set the working directory in the container to /console
WORKDIR /console
# Create the pnpm directory and set the PNPM_HOME environment variable
RUN mkdir -p ~/.pnpm
ENV PNPM_HOME /root/.pnpm
# Set environment
ARG ENVIRONMENT=production
# Add the pnpm global bin to the PATH
ENV PATH /root/.pnpm/bin:$PATH
# Copy pnpm-lock.yaml (or package.json) into the directory /console in the container
COPY console/package.json console/pnpm-lock.yaml ./
# Copy over .npmrc if applicable
COPY console/.npmr[c] ./
# Install global dependencies
RUN npm install -g ember-cli pnpm
# Install git
RUN apk update && apk add git openssh-client
# Trust GitHub's RSA host key
RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
# Install app dependencies
RUN pnpm install
# Copy the console directory contents into the container at /console
COPY console .
# Build the application
RUN pnpm build --environment $ENVIRONMENT
# ---- Serve Stage ----
FROM nginx:alpine
# Copy the built app to our served directory
COPY --from=builder /console/dist /usr/share/nginx/html
# Expose the port nginx is bound to
EXPOSE 4200
# Use custom nginx.conf
COPY console/nginx.conf /etc/nginx/conf.d/default.conf
# Start Nginx server
CMD ["nginx", "-g", "daemon off;"]

View File

@@ -1,8 +1,8 @@
# ---- Build Stage ----
FROM node:18.15.0-alpine AS builder
FROM node:18.15.0-alpine
# Set the working directory in the container to /app
WORKDIR /app
# Set the working directory in the container to /console
WORKDIR /console
# Create the pnpm directory and set the PNPM_HOME environment variable
RUN mkdir -p ~/.pnpm
@@ -14,7 +14,7 @@ ARG ENVIRONMENT=production
# Add the pnpm global bin to the PATH
ENV PATH /root/.pnpm/bin:$PATH
# Copy pnpm-lock.yaml (or package.json) into the directory /app in the container
# Copy pnpm-lock.yaml (or package.json) into the directory /console in the container
COPY console/package.json console/pnpm-lock.yaml ./
# Copy over .npmrc if applicable
@@ -32,23 +32,26 @@ RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
# Install app dependencies
RUN pnpm install
# Copy the console directory contents into the container at /app
# Copy the console directory contents into the container at /console
COPY console .
# Build the application
RUN pnpm build --environment $ENVIRONMENT
# ---- Serve Stage ----
FROM nginx:alpine
# # Make sure the build output is available in /console/dist
# RUN ls -la /console/dist
# Copy the built app to our served directory
COPY --from=builder /app/dist /usr/share/nginx/html
# # ---- Serve Stage ----
# FROM nginx:alpine
# Expose the port nginx is bound to
EXPOSE 4200
# # Copy the built app to our served directory
# COPY --from=builder /console/dist /usr/share/nginx/html
# Use custom nginx.conf
COPY console/nginx.conf /etc/nginx/conf.d/default.conf
# # Expose the port nginx is bound to
# EXPOSE 4201
# Start Nginx server
CMD ["nginx", "-g", "daemon off;"]
# # Use custom nginx.conf
# COPY console/nginx.conf /etc/nginx/conf.d/default.conf
# # Start Nginx server
# CMD ["nginx", "-g", "daemon off;"]

View File

@@ -1 +0,0 @@
{{yield}}

View File

@@ -1,191 +0,0 @@
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { inject as service } from '@ember/service';
import { isArray } from '@ember/array';
import { getOwner } from '@ember/application';
import { later } from '@ember/runloop';
import { task, timeout } from 'ember-concurrency';
import { injectAsset } from '../utils/asset-injector';
import getMountedEngineRoutePrefix from '@fleetbase/ember-core/utils/get-mounted-engine-route-prefix';
function removeTrailingDot (str) {
if (str.endsWith('.')) {
return str.slice(0, -1);
}
return str;
}
window.exports = window.exports ?? {};
export default class ExtensionInjectorComponent extends Component {
@service fetch;
@service notifications;
@service universe;
@tracked engines = [];
@tracked packages = [];
constructor () {
super(...arguments);
this.loadInstalledEngines.perform();
}
@task *loadInstalledEngines () {
yield timeout(300);
try {
const engines = yield this.fetch.get('load-installed-engines', {}, { namespace: '~registry/v1' });
for (const id in engines) {
yield this.loadAndMountEngine.perform(id, engines[id]);
}
} catch (error) {
this.notifications.serverError(error);
}
}
@task *loadAndMountEngine (id, enginePackage) {
const engineName = enginePackage.name;
const assets = yield this.fetch.get(`load-engine-manifest/${id}`, {}, { namespace: '~registry/v1' });
if (isArray(assets)) {
for (const i in assets) {
injectAsset(assets[i]);
}
}
yield timeout(300);
this.registerEngine(enginePackage);
}
registerEngine (enginePackage) {
const engineName = enginePackage.name;
const owner = getOwner(this);
const router = getOwner(this).lookup('router:main');
if (this.hasAssetManifest(engineName)) {
return this.universe.loadEngine(engineName).then(engineInstance => {
if (engineInstance.base && engineInstance.base.setupExtension) {
engineInstance.base.setupExtension(owner, engineInstance, this.universe);
}
});
}
try {
if (router._engineIsLoaded(engineName)) {
router._registerEngine(engineName);
const instanceId = Object.values(router._engineInstances).length;
const mountPoint = removeTrailingDot(getMountedEngineRoutePrefix(engineName.replace('@fleetbase/', ''), enginePackage.fleetbase));
this.universe.constructEngineInstance(engineName, instanceId, mountPoint).then(engineInstance => {
if (engineInstance) {
this.setupEngine(owner, engineInstance, enginePackage);
this.setEnginePromise(engineName, engineInstance);
this.addEngineRoutesToRouter(engineName, engineInstance, instanceId, mountPoint, router);
this.addEngineRoutesToRecognizer(engineName, router);
this.resolveEngineRegistrations(engineInstance);
console.log(engineInstance, router, owner);
if (engineInstance.base && engineInstance.base.setupExtension) {
engineInstance.base.setupExtension(owner, engineInstance, this.universe);
}
}
});
}
} catch (error) {
console.trace(error);
}
}
setupEngine (appInstance, engineInstance, enginePackage) {
const engineName = enginePackage.name;
appInstance.application.engines[engineName] = engineInstance.dependencies ?? { externalRoutes: {}, services: {} };
appInstance._dependenciesForChildEngines[engineName] = engineInstance.dependencies ?? { externalRoutes: {}, services: {} };
if (isArray(appInstance.application.extensions)) {
appInstance.application.extensions.push(enginePackage);
}
}
addEngineRoutesToRecognizer (engineName, router) {
const recognizer = router._routerMicrolib.recognizer || router._router._routerMicrolib.recognizer;
if (recognizer) {
let routeName = `${engineName}.application`;
recognizer.add(
[
{
path: 'console.fleet-ops',
handler: 'console.fleet-ops',
},
],
{ as: 'console.fleet-ops' }
);
}
}
addEngineRoutesToRouter (engineName, engineInstance, instanceId, mountPoint, router) {
const getRouteInfo = routeName => {
const applicationRoute = routeName.replace(mountPoint, '') === '';
return {
fullName: mountPoint,
instanceId,
localFullName: applicationRoute ? 'application' : routeName.replace(`${mountPoint}.`, ''),
mountPoint,
name: engineName,
};
};
const routes = ['console.fleet-ops', 'console.fleet-ops.home'];
for (let i = 0; i < routes.length; i++) {
const routeName = routes[i];
router._engineInfoByRoute[routeName] = getRouteInfo(routeName);
}
// Reinitialize or refresh the router
router.setupRouter();
}
setEnginePromise (engineName, engineInstance) {
const router = getOwner(this).lookup('router:main');
if (router) {
router._enginePromises[engineName] = { manual: engineInstance._bootPromise };
}
}
resolveEngineRegistrations (engineInstance) {
const owner = getOwner(this);
const registry = engineInstance.__registry__;
const registrations = registry.registrations;
const getOwnerSymbol = obj => {
const symbols = Object.getOwnPropertySymbols(obj);
const ownerSymbol = symbols.find(symbol => symbol.toString() === 'Symbol(OWNER)');
return ownerSymbol;
};
for (let registrationKey in registrations) {
const registrationInstance = registrations[registrationKey];
if (typeof registrationInstance === 'string') {
// Try to resolve from owner
let resolvedRegistrationInstance = owner.lookup(registrationKey);
// Hack for host-router
if (registrationKey === 'service:host-router') {
resolvedRegistrationInstance = owner.lookup('service:router');
}
if (resolvedRegistrationInstance) {
// Correct the owner
resolvedRegistrationInstance[getOwnerSymbol(resolvedRegistrationInstance)] = engineInstance;
// Resolve
registrations[registrationKey] = resolvedRegistrationInstance;
}
}
}
}
hasAssetManifest (engineName) {
const router = getOwner(this).lookup('router:main');
if (router._assetLoader) {
const manifest = router._assetLoader.getManifest();
if (manifest && manifest.bundles) {
return manifest.bundles[engineName] !== undefined;
}
}
return false;
}
}

View File

@@ -1,3 +0,0 @@
{{#if this.ready}}
{{mount "@fleetbase/fleetops-engine"}}
{{/if}}

View File

@@ -1,46 +0,0 @@
export function injectAsset ({ type, content, name, syntax }) {
switch (type) {
case 'css':
injectStylesheet(content, syntax);
break;
case 'meta':
injectMeta(name, content);
break;
case 'js':
default:
injectScript(content, syntax);
break;
}
}
export function injectMeta (name, content) {
const meta = document.createElement('meta');
meta.name = name;
meta.content = content;
document.head.appendChild(meta);
}
export function injectScript (content, type = 'application/javascript') {
const script = document.createElement('script');
script.type = type;
script.text = content;
document.head.appendChild(script);
}
export function injectStylesheet (content, type = 'text/css') {
const style = document.createElement('style');
style.type = type;
if (style.styleSheet) {
style.styleSheet.cssText = content;
} else {
style.appendChild(document.createTextNode(content));
}
document.head.appendChild(style);
}
export default {
injectAsset,
injectMeta,
injectScript,
injectStylesheet,
};

View File

@@ -2,6 +2,7 @@
const toBoolean = require('./utils/to-boolean');
const getenv = require('./utils/getenv');
const fixApiHost = require('./utils/fix-api-host');
const asArray = require('./utils/as-array');
const { version } = require('../package');
module.exports = function (environment) {
@@ -20,7 +21,7 @@ module.exports = function (environment) {
},
APP: {
showExtensionsLink: toBoolean(getenv('SHOW_EXTENSIONS_LINK', true)),
extensions: asArray(getenv('EXTENSIONS')),
},
API: {
@@ -29,8 +30,8 @@ module.exports = function (environment) {
},
osrm: {
host: getenv('OSRM_HOST', 'https://bundle.routing.fleetbase.io'),
servers: getenv('OSRM_SERVERS', '').split(',').filter(Boolean),
host: getenv('OSRM_HOST', 'https://router.project-osrm.org'),
servers: {},
},
socket: {

View File

@@ -1,5 +1,6 @@
module.exports = function () {
return {
'free-solid-svg-icons': 'all',
'free-brands-svg-icons': 'all',
};
};

View File

@@ -0,0 +1,11 @@
module.exports = function asArray(value) {
if (Array.isArray(value)) {
return value;
}
if (typeof value === 'string' && value.includes(',')) {
return value.split(',');
}
return [];
};

View File

@@ -4,5 +4,4 @@ SOCKETCLUSTER_PATH=/socketcluster/
SOCKETCLUSTER_HOST=localhost
SOCKETCLUSTER_SECURE=false
SOCKETCLUSTER_PORT=38000
OSRM_HOST=https://bundle.routing.fleetbase.io
OSRM_SERVERS=https://canada.routing.fleetbase.io,https://us.routing.fleetbase.io
OSRM_HOST=https://router.project-osrm.org

View File

@@ -5,5 +5,4 @@ SOCKETCLUSTER_PATH=/socketcluster/
SOCKETCLUSTER_HOST=
SOCKETCLUSTER_SECURE=true
SOCKETCLUSTER_PORT=38000
OSRM_HOST=https://bundle.routing.fleetbase.io
OSRM_SERVERS=https://canada.routing.fleetbase.io,https://us.routing.fleetbase.io
OSRM_HOST=https://router.project-osrm.org

View File

@@ -1,6 +1,6 @@
{
"name": "@fleetbase/console",
"version": "0.4.27",
"version": "0.5.3",
"private": true,
"description": "Modular logistics and supply chain operating system (LSOS)",
"repository": "https://github.com/fleetbase/fleetbase",
@@ -29,16 +29,17 @@
"test:ember": "ember test"
},
"dependencies": {
"@fleetbase/ember-core": "^0.2.12",
"@fleetbase/ember-ui": "^0.2.18",
"@fleetbase/fleetops-engine": "^0.5.3",
"@fleetbase/storefront-engine": "^0.3.12",
"@fleetbase/dev-engine": "^0.2.4",
"@fleetbase/iam-engine": "^0.0.13",
"@fleetbase/ember-core": "^0.2.14",
"@fleetbase/ember-ui": "^0.2.20",
"@fleetbase/fleetops-engine": "^0.5.5",
"@fleetbase/storefront-engine": "^0.3.13",
"@fleetbase/dev-engine": "^0.2.5",
"@fleetbase/iam-engine": "^0.0.14",
"@fleetbase/registry-bridge-engine": "^0.0.11",
"@fleetbase/fleetops-data": "^0.1.17",
"@fleetbase/leaflet-routing-machine": "^3.2.16",
"@ember/legacy-built-in-components": "^0.4.1",
"@fortawesome/ember-fontawesome": "^0.4.1",
"@fortawesome/ember-fontawesome": "^2.0.0",
"ember-changeset": "^4.1.2",
"ember-changeset-validations": "^4.1.1",
"ember-composable-helpers": "^5.0.0",
@@ -47,7 +48,7 @@
"ember-gridstack": "^4.0.0",
"ember-intl": "6.3.2",
"ember-math-helpers": "^2.18.2",
"ember-power-select": "^6.0.1",
"ember-power-select": "^7.2.0",
"ember-prism": "^0.13.0",
"ember-radio-button": "3.0.0-beta.1",
"ember-tag-input": "^3.1.0",
@@ -66,9 +67,9 @@
"@ember/optional-features": "^2.0.0",
"@ember/string": "^3.1.1",
"@ember/test-helpers": "^3.2.0",
"@fortawesome/fontawesome-svg-core": "^6.4.0",
"@fortawesome/free-brands-svg-icons": "^6.4.0",
"@fortawesome/free-solid-svg-icons": "^6.4.0",
"@fortawesome/fontawesome-svg-core": "6.4.0",
"@fortawesome/free-brands-svg-icons": "6.4.0",
"@fortawesome/free-solid-svg-icons": "6.4.0",
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2",
"@tailwindcss/forms": "^0.5.3",
@@ -142,8 +143,8 @@
},
"pnpm": {
"overrides": {
"@fleetbase/ember-core": "^0.2.12",
"@fleetbase/ember-ui": "^0.2.18",
"@fleetbase/ember-core": "^0.2.14",
"@fleetbase/ember-ui": "^0.2.20",
"@fleetbase/fleetops-data": "^0.1.17"
}
},

25384
console/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,26 +0,0 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from '@fleetbase/console/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | extension-injector', function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<ExtensionInjector />`);
assert.dom().hasText('');
// Template block usage:
await render(hbs`
<ExtensionInjector>
template block text
</ExtensionInjector>
`);
assert.dom().hasText('template block text');
});
});

View File

@@ -1,10 +0,0 @@
import assetInjector from '@fleetbase/console/utils/asset-injector';
import { module, test } from 'qunit';
module('Unit | Utility | asset-injector', function () {
// TODO: Replace this with your real tests.
test('it works', function (assert) {
let result = assetInjector();
assert.ok(result);
});
});

View File

@@ -1,5 +1,3 @@
version: "3.8"
services:
cache:
image: redis:4-alpine
@@ -38,9 +36,18 @@ services:
CACHE_URL: tcp://cache
REDIS_URL: tcp://cache
application:
console:
build:
context: .
dockerfile: console/Dockerfile.server-build
args:
ENVIRONMENT: development
ports:
- "4201:4201"
- "4200:4200"
volumes:
- console-build:/console
application:
build:
context: .
dockerfile: docker/Dockerfile
@@ -48,7 +55,10 @@ services:
args:
ENVIRONMENT: development
GITHUB_AUTH_KEY: ${GITHUB_AUTH_KEY}
volumes:
- console-build:/fleetbase/console
environment:
ENVIRONMENT: development
DATABASE_URL: "mysql://root@database/fleetbase"
QUEUE_CONNECTION: redis
CACHE_DRIVER: redis
@@ -63,6 +73,9 @@ services:
MODEL_CACHE_ENABLED: 'true'
RESPONSE_CACHE_ENABLED: 'true'
RESPONSE_CACHE_DRIVER: redis
REGISTRY_HOST: https://registry.fleetbase.io
REGISTRY_PREINSTALLED_EXTENSIONS: 'true'
OSRM_HOST: https://router.project-osrm.org
depends_on:
- database
- cache
@@ -76,3 +89,6 @@ services:
- "8000:80"
depends_on:
- application
volumes:
console-build:

View File

@@ -1,6 +1,6 @@
# syntax = docker/dockerfile:1.2
# Base stage
FROM dunglas/frankenphp:1.1.0-php8.2-bookworm as base
FROM dunglas/frankenphp:1.2.2-php8.2-bookworm as base
# Install packages
RUN apt-get update && apt-get install -y git bind9-utils mycli nodejs npm nano \
@@ -31,17 +31,17 @@ 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 pnpm ember-cli
RUN npm install -g chokidar pnpm ember-cli npm-cli-login
# 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
# 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
# Add the pnpm global bin to the PATH
ENV PATH /root/.pnpm/bin:$PATH
# Set some build ENV variables
ENV LOG_CHANNEL=stdout
@@ -63,33 +63,7 @@ ARG GITHUB_AUTH_KEY
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 --
RUN mkdir -p /fleetbase/api && mkdir -p /fleetbase/console && chown -R www-data:www-data /fleetbase
# Set working directory
WORKDIR /fleetbase/api
@@ -156,9 +130,9 @@ CMD ["php", "artisan", "queue:work"]
FROM base as app-dev
ENTRYPOINT ["docker-php-entrypoint"]
# Add --watch flag later
CMD ["sh", "-c", "php artisan octane:frankenphp --port=8000 --host=0.0.0.0 --caddyfile $CADDYFILE_PATH"]
CMD ["sh", "-c", "php artisan octane:frankenphp --workers=6 --max-requests=250 --port=8000 --host=0.0.0.0 --caddyfile $CADDYFILE_PATH"]
# Application stage
FROM base as app
ENTRYPOINT ["/sbin/ssm-parent", "-c", ".ssm-parent.yaml", "run", "--", "docker-php-entrypoint"]
CMD ["sh", "-c", "php artisan octane:frankenphp --port=8000 --host=0.0.0.0 --https --http-redirect --caddyfile $CADDYFILE_PATH"]
CMD ["sh", "-c", "php artisan octane:frankenphp --workers=6 --max-requests=250 --port=8000 --host=0.0.0.0 --https --http-redirect --caddyfile $CADDYFILE_PATH"]

1
packages/ledger Submodule

Submodule packages/ledger added at 1f6f27f501