mirror of
https://github.com/fleetbase/fleetbase.git
synced 2026-02-24 18:07:06 +00:00
Compare commits
97 Commits
feature/fu
...
6980b44239
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6980b44239 | ||
|
|
a349f20298 | ||
|
|
2b0735efbd | ||
|
|
fdabe55ce2 | ||
|
|
369fe0e66f | ||
|
|
2ee81c5c26 | ||
|
|
6951ee7003 | ||
|
|
a824e7da85 | ||
|
|
c85b761c28 | ||
|
|
9080265806 | ||
|
|
5a40d964fe | ||
|
|
2bcd29363c | ||
|
|
5894500121 | ||
|
|
fee801c38f | ||
|
|
151ce5d82d | ||
|
|
533f175de0 | ||
|
|
0d6b8edcc8 | ||
|
|
3f848fd9d8 | ||
|
|
182a5e5d45 | ||
|
|
253c68e0ac | ||
|
|
54bee62335 | ||
|
|
23a8c8596e | ||
|
|
18596450ee | ||
|
|
3c013a3817 | ||
|
|
4392c7e3ff | ||
|
|
97dfbedd1a | ||
|
|
6d13f22a98 | ||
|
|
2c09c87bb6 | ||
|
|
f7f6991ef3 | ||
|
|
73acd4833c | ||
|
|
1c3c4c16a5 | ||
|
|
5d01438dc9 | ||
|
|
9d004410ee | ||
|
|
3a396f3b54 | ||
|
|
e86b970fc8 | ||
|
|
122a0d186a | ||
|
|
7e258f698f | ||
|
|
65ef642315 | ||
|
|
d79f034dbd | ||
|
|
05b7d5e112 | ||
|
|
61779ab102 | ||
|
|
a287c05380 | ||
|
|
ecc41e587e | ||
|
|
166529f9b4 | ||
|
|
189547f9de | ||
|
|
90a42e8a93 | ||
|
|
d28b1d41fb | ||
|
|
b056ef62b0 | ||
|
|
e70cbacbc2 | ||
|
|
fbd4a7490a | ||
|
|
b9b0eb308b | ||
|
|
48e1b89ec8 | ||
|
|
5e02c95b66 | ||
|
|
db8b5c4d6a | ||
|
|
aa214ccad7 | ||
|
|
cdd5524cf3 | ||
|
|
d99cefd2a4 | ||
|
|
1c58fd43c3 | ||
|
|
9226394159 | ||
|
|
9b23b39f32 | ||
|
|
5310fc3ff3 | ||
|
|
9569053f50 | ||
|
|
b08c054b99 | ||
|
|
2e517f2f95 | ||
|
|
7038d375b0 | ||
|
|
d5ea7f7790 | ||
|
|
4eb4b04121 | ||
|
|
24c5b93005 | ||
|
|
80610b9a48 | ||
|
|
9e5551972e | ||
|
|
b784f890f3 | ||
|
|
797a3d61fe | ||
|
|
d2f0bfe83e | ||
|
|
f28ad85c1a | ||
|
|
d7b0826f3f | ||
|
|
dd6008a8aa | ||
|
|
6671fefaaa | ||
|
|
7136f6195c | ||
|
|
2384887620 | ||
|
|
a2778f1552 | ||
|
|
acfda5ed1a | ||
|
|
e08255007a | ||
|
|
41761ea50e | ||
|
|
5c623819ed | ||
|
|
2bd885b1a2 | ||
|
|
88c3842441 | ||
|
|
2c2a4121a8 | ||
|
|
aadd03f14b | ||
|
|
706e94270d | ||
|
|
1dabc375f9 | ||
|
|
0efec46155 | ||
|
|
8bb2c6b65d | ||
|
|
1c0af1a119 | ||
|
|
dd65ee619b | ||
|
|
e790a0e123 | ||
|
|
723e3ca3d1 | ||
|
|
4eb706d33e |
@@ -9,11 +9,13 @@
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"require": {
|
||||
"php": "^8.0",
|
||||
"appstract/laravel-opcache": "^4.0",
|
||||
"fleetbase/core-api": "^1.6.2",
|
||||
"fleetbase/fleetops-api": "^0.6.5",
|
||||
"fleetbase/core-api": "^1.5.22",
|
||||
"fleetbase/fleetops-api": "^0.5.16",
|
||||
"fleetbase/registry-bridge": "^0.0.18",
|
||||
"fleetbase/storefront-api": "^0.3.30",
|
||||
"fleetbase/billing-api": "^0.1.6",
|
||||
"fleetbase/internals-api": "^0.0.9",
|
||||
"fleetbase/flespi-integration": "^0.1.13",
|
||||
"fleetbase/storefront-api": "^0.3.20",
|
||||
"guzzlehttp/guzzle": "^7.0.1",
|
||||
"laravel/framework": "^10.0",
|
||||
"laravel/octane": "^2.3",
|
||||
@@ -38,9 +40,17 @@
|
||||
"phpunit/phpunit": "^10.0"
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/fleetbase/billing"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/fleetbase/internals"
|
||||
},
|
||||
{
|
||||
"type": "composer",
|
||||
"url": "https://registry.fleetbase.io"
|
||||
"url": "https://registry.qa.fleetbase.io"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
|
||||
2085
api/composer.lock
generated
2085
api/composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'url' => env('OPCACHE_URL', config('app.url')),
|
||||
'prefix' => 'opcache-api',
|
||||
'verify' => true,
|
||||
'headers' => [],
|
||||
'directories' => [
|
||||
base_path('app'),
|
||||
base_path('bootstrap'),
|
||||
base_path('public'),
|
||||
base_path('resources'),
|
||||
base_path('routes'),
|
||||
base_path('storage'),
|
||||
base_path('vendor'),
|
||||
],
|
||||
'exclude' => [
|
||||
'test',
|
||||
'Test',
|
||||
'tests',
|
||||
'Tests',
|
||||
'stub',
|
||||
'Stub',
|
||||
'stubs',
|
||||
'Stubs',
|
||||
'dumper',
|
||||
'Dumper',
|
||||
'Autoload',
|
||||
],
|
||||
];
|
||||
@@ -26,14 +26,10 @@ php artisan schedule-monitor:sync
|
||||
|
||||
# Clear cache
|
||||
php artisan cache:clear
|
||||
php artisan route:clear
|
||||
|
||||
# Optimize
|
||||
php artisan config:cache
|
||||
php artisan route:cache
|
||||
# php artisan config:cache
|
||||
# php artisan route:cache
|
||||
|
||||
# Initialize registry
|
||||
php artisan registry:init
|
||||
|
||||
# Restart octane
|
||||
# php artisan octane:reload
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
{{/if}}
|
||||
</InputGroup>
|
||||
<InputGroup @wrapperClass="mb-0i">
|
||||
<Checkbox @label="APN Production" @value={{this.apn.production}} @onToggle={{this.toggleApnProduction}} />
|
||||
<Checkbox @label="APN Production" @value={{this.apn.production}} @onToggle={{fn (mut this.apn.production)}} @disabled={{this.isLoading}} />
|
||||
</InputGroup>
|
||||
</ContentPanel>
|
||||
|
||||
|
||||
@@ -32,13 +32,6 @@ export default class ConfigureNotificationChannelsComponent extends Component {
|
||||
this.loadConfigValues();
|
||||
}
|
||||
|
||||
@action toggleApnProduction(checked) {
|
||||
this.apn = {
|
||||
...this.apn,
|
||||
production: checked,
|
||||
};
|
||||
}
|
||||
|
||||
@action removeApnFile() {
|
||||
const apnConfig = this.apn;
|
||||
apnConfig.private_key_file = null;
|
||||
|
||||
@@ -22,12 +22,7 @@
|
||||
</head>
|
||||
<body>
|
||||
{{content-for "body"}}
|
||||
<div id="boot-loader" class="overloader">
|
||||
<div class="loader-container">
|
||||
<span class="fleetbase-loader" width="16" height="16"></span>
|
||||
<div class="loading-message">Starting up...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="{{rootURL}}assets/vendor.js"></script>
|
||||
<script src="{{rootURL}}assets/@fleetbase/console.js"></script>
|
||||
|
||||
|
||||
@@ -55,9 +55,12 @@ Router.map(function () {
|
||||
this.route('index', { path: '/' }, function () {
|
||||
this.route('users', { path: '/:public_id/users' });
|
||||
});
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
});
|
||||
this.route('schedule-monitor', function () {
|
||||
this.route('logs', { path: '/:id/logs' });
|
||||
>>>>>>> 23d5ecfdb856aac664f6124188de619f036d825b
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -4,7 +4,6 @@ import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
import isElectron from '@fleetbase/ember-core/utils/is-electron';
|
||||
import pathToRoute from '@fleetbase/ember-core/utils/path-to-route';
|
||||
import removeBootLoader from '../utils/remove-boot-loader';
|
||||
|
||||
export default class ApplicationRoute extends Route {
|
||||
@service session;
|
||||
@@ -89,17 +88,6 @@ export default class ApplicationRoute extends Route {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove boot loader if not authenticated.
|
||||
*
|
||||
* @memberof ApplicationRoute
|
||||
*/
|
||||
afterModel() {
|
||||
if (!this.session.isAuthenticated) {
|
||||
removeBootLoader();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the application's theme settings, applying necessary class names and default theme configurations.
|
||||
*
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
import removeBootLoader from '../utils/remove-boot-loader';
|
||||
import '@fleetbase/leaflet-routing-machine';
|
||||
|
||||
export default class ConsoleRoute extends Route {
|
||||
@@ -38,7 +37,6 @@ export default class ConsoleRoute extends Route {
|
||||
*/
|
||||
async afterModel(model, transition) {
|
||||
this.universe.callHooks('console:after-model', this.session, this.router, model, transition);
|
||||
removeBootLoader();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,32 +38,3 @@ body[data-theme='dark'] .two-fa-enforcement-alert button#two-fa-setup-button.btn
|
||||
body.console-admin-organizations-index-index .next-table-wrapper > table {
|
||||
table-layout: auto;
|
||||
}
|
||||
|
||||
#boot-loader {
|
||||
position: absolute;
|
||||
z-index: 9999999999;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#boot-loader > .loader-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#boot-loader > .loader-container > .loading-message {
|
||||
margin-left: 0.5rem;
|
||||
font-weight: 600;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
body[data-theme='dark'] #boot-loader > .loader-container > .loading-message {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
export default function removeBootLoader() {
|
||||
const bootLoaderElement = document.getElementById('boot-loader');
|
||||
if (bootLoaderElement && typeof bootLoaderElement.remove === 'function') {
|
||||
bootLoaderElement.remove();
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
API_HOST=
|
||||
API_HOST=https://api.fleetbase.io
|
||||
API_NAMESPACE=int/v1
|
||||
API_SECURE=true
|
||||
SOCKETCLUSTER_PATH=/socketcluster/
|
||||
SOCKETCLUSTER_HOST=
|
||||
SOCKETCLUSTER_HOST=socket.fleetbase.io
|
||||
SOCKETCLUSTER_SECURE=true
|
||||
SOCKETCLUSTER_PORT=38000
|
||||
OSRM_HOST=https://router.project-osrm.org
|
||||
SOCKETCLUSTER_PORT=8000
|
||||
OSRM_HOST=https://router.project-osrm.org
|
||||
|
||||
9
console/environments/.env.qa
Normal file
9
console/environments/.env.qa
Normal file
@@ -0,0 +1,9 @@
|
||||
API_HOST=https://api.qa.fleetbase.io
|
||||
API_NAMESPACE=int/v1
|
||||
API_SECURE=true
|
||||
SOCKETCLUSTER_PATH=/socketcluster/
|
||||
SOCKETCLUSTER_HOST=socket.qa.fleetbase.io
|
||||
SOCKETCLUSTER_SECURE=true
|
||||
SOCKETCLUSTER_PORT=8000
|
||||
OSRM_HOST=https://bundle.routing.fleetbase.io
|
||||
OSRM_SERVERS=https://canada.routing.fleetbase.io,https://us.routing.fleetbase.io
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@fleetbase/console",
|
||||
"version": "0.6.8",
|
||||
"version": "0.5.20",
|
||||
"private": true,
|
||||
"description": "Modular logistics and supply chain operating system (LSOS)",
|
||||
"repository": "https://github.com/fleetbase/fleetbase",
|
||||
@@ -29,18 +29,21 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@ember/legacy-built-in-components": "^0.4.2",
|
||||
"@fleetbase/dev-engine": "^0.2.9",
|
||||
"@fleetbase/ember-core": "latest",
|
||||
"@fleetbase/ember-ui": "latest",
|
||||
"@fleetbase/fleetops-data": "latest",
|
||||
"@fleetbase/fleetops-engine": "^0.6.5",
|
||||
"@fleetbase/fleetops-engine": "^0.5.16",
|
||||
"@fleetbase/iam-engine": "^0.1.3",
|
||||
"@fleetbase/dev-engine": "^0.2.9",
|
||||
"@fleetbase/leaflet-routing-machine": "^3.2.16",
|
||||
"@fleetbase/registry-bridge-engine": "^0.0.18",
|
||||
"@fleetbase/storefront-engine": "^0.3.30",
|
||||
"@fleetbase/storefront-engine": "^0.3.20",
|
||||
"@fleetbase/billing-engine": "^0.1.6",
|
||||
"@fleetbase/internals-engine": "^0.0.9",
|
||||
"@fleetbase/flespi-engine": "^0.1.13",
|
||||
"@fortawesome/ember-fontawesome": "^2.0.0",
|
||||
"ember-changeset": "4.1.2",
|
||||
"ember-changeset-validations": "4.1.2",
|
||||
"ember-changeset": "^4.1.2",
|
||||
"ember-changeset-validations": "^4.1.1",
|
||||
"ember-composable-helpers": "^5.0.0",
|
||||
"ember-concurrency": "^3.1.1",
|
||||
"ember-concurrency-decorators": "^2.0.3",
|
||||
@@ -56,7 +59,6 @@
|
||||
"postcss-nth-list": "^1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@embroider/macros": "1.16.12",
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/eslint-parser": "^7.25.1",
|
||||
"@babel/plugin-proposal-decorators": "^7.24.7",
|
||||
@@ -128,7 +130,7 @@
|
||||
"stylelint-prettier": "^4.1.0",
|
||||
"tailwindcss": "^3.4.10",
|
||||
"tracked-built-ins": "^3.3.0",
|
||||
"webpack": "^5.98.0"
|
||||
"webpack": "^5.94.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
|
||||
4780
console/pnpm-lock.yaml
generated
4780
console/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,10 +0,0 @@
|
||||
import removeBootLoader from '@fleetbase/console/utils/remove-boot-loader';
|
||||
import { module, test } from 'qunit';
|
||||
|
||||
module('Unit | Utility | remove-boot-loader', function () {
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it works', function (assert) {
|
||||
let result = removeBootLoader();
|
||||
assert.ok(result);
|
||||
});
|
||||
});
|
||||
@@ -1,11 +1,6 @@
|
||||
services:
|
||||
cache:
|
||||
image: redis:4-alpine
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
database:
|
||||
image: mysql:8.0-oracle
|
||||
@@ -17,11 +12,6 @@ services:
|
||||
environment:
|
||||
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
|
||||
MYSQL_DATABASE: "fleetbase"
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
socket:
|
||||
image: socketcluster/socketcluster:v17.4.0
|
||||
@@ -38,11 +28,6 @@ services:
|
||||
target: events-dev
|
||||
args:
|
||||
ENVIRONMENT: development
|
||||
healthcheck:
|
||||
test: ["CMD", "php", "artisan", "queue:status"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
environment:
|
||||
DATABASE_URL: "mysql://root@database/fleetbase"
|
||||
QUEUE_CONNECTION: redis
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# syntax = docker/dockerfile:1.2
|
||||
# Base stage
|
||||
FROM dunglas/frankenphp:1.5.0-php8.2-bookworm as base
|
||||
FROM dunglas/frankenphp:1.2.3-php8.2-bookworm as base
|
||||
|
||||
# Install packages
|
||||
RUN apt-get update && apt-get install -y git bind9-utils mycli nodejs npm nano \
|
||||
@@ -20,35 +20,11 @@ RUN install-php-extensions \
|
||||
opcache \
|
||||
memcached \
|
||||
imagick \
|
||||
# geos \
|
||||
geos \
|
||||
sockets \
|
||||
pcntl \
|
||||
@composer
|
||||
|
||||
# Install build dependencies for GEOS
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
pkg-config \
|
||||
libgeos-dev \
|
||||
libgeos++-dev \
|
||||
autoconf \
|
||||
build-essential \
|
||||
unzip \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Download, extract, compile, and enable the php-geos extension
|
||||
RUN curl -fsSL -o php-geos.zip \
|
||||
https://github.com/libgeos/php-geos/archive/dfe1ab17b0f155cc315bc13c75689371676e02e1.zip \
|
||||
&& unzip php-geos.zip \
|
||||
&& rm php-geos.zip \
|
||||
&& cd php-geos-* \
|
||||
&& ./autogen.sh \
|
||||
&& ./configure \
|
||||
&& make -j"$(nproc)" install \
|
||||
&& docker-php-ext-enable geos \
|
||||
&& cd .. \
|
||||
&& rm -rf php-geos-*
|
||||
|
||||
# Update PHP configurations
|
||||
RUN sed -e 's/^expose_php.*/expose_php = Off/' "$PHP_INI_DIR/php.ini-production" > "$PHP_INI_DIR/php.ini" \
|
||||
&& sed -i -e 's/^upload_max_filesize.*/upload_max_filesize = 600M/' -e 's/^post_max_size.*/post_max_size = 0/' \
|
||||
@@ -153,9 +129,10 @@ CMD ["php", "artisan", "queue:work"]
|
||||
# Application dev stage
|
||||
FROM base as app-dev
|
||||
ENTRYPOINT ["docker-php-entrypoint"]
|
||||
CMD ["sh", "-c", "php artisan octane:frankenphp --max-requests=250 --port=8000 --host=0.0.0.0 --watch"]
|
||||
# Add --watch flag later
|
||||
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 --max-requests=250 --port=8000 --host=0.0.0.0"]
|
||||
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,154 +0,0 @@
|
||||
# syntax = docker/dockerfile:1.2
|
||||
# Base stage
|
||||
FROM dunglas/frankenphp:1.5.0-php8.2-bookworm AS base
|
||||
|
||||
# Install packages
|
||||
RUN apt-get update && apt-get install -y git bind9-utils mycli nodejs npm nano mariadb-server redis-server \
|
||||
&& mkdir -p /root/.ssh \
|
||||
&& ssh-keyscan github.com >> /root/.ssh/known_hosts
|
||||
|
||||
# Install PHP Extensions
|
||||
RUN install-php-extensions \
|
||||
pdo_mysql \
|
||||
gd \
|
||||
bcmath \
|
||||
redis \
|
||||
intl \
|
||||
zip \
|
||||
gmp \
|
||||
apcu \
|
||||
opcache \
|
||||
memcached \
|
||||
imagick \
|
||||
# geos \
|
||||
sockets \
|
||||
pcntl \
|
||||
@composer
|
||||
|
||||
# Install build dependencies for GEOS
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
pkg-config \
|
||||
libgeos-dev \
|
||||
libgeos++-dev \
|
||||
autoconf \
|
||||
build-essential \
|
||||
unzip \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Download, extract, compile, and enable the php-geos extension
|
||||
RUN curl -fsSL -o php-geos.zip \
|
||||
https://github.com/libgeos/php-geos/archive/dfe1ab17b0f155cc315bc13c75689371676e02e1.zip \
|
||||
&& unzip php-geos.zip \
|
||||
&& rm php-geos.zip \
|
||||
&& cd php-geos-* \
|
||||
&& ./autogen.sh \
|
||||
&& ./configure \
|
||||
&& make -j"$(nproc)" install \
|
||||
&& docker-php-ext-enable geos \
|
||||
&& cd .. \
|
||||
&& rm -rf php-geos-*
|
||||
|
||||
# Update PHP configurations
|
||||
RUN sed -e 's/^expose_php.*/expose_php = Off/' "$PHP_INI_DIR/php.ini-production" > "$PHP_INI_DIR/php.ini" \
|
||||
&& sed -i -e 's/^upload_max_filesize.*/upload_max_filesize = 600M/' -e 's/^post_max_size.*/post_max_size = 0/' \
|
||||
-e 's/^memory_limit.*/memory_limit = 600M/' "$PHP_INI_DIR/php.ini"
|
||||
|
||||
# Install global node modules
|
||||
RUN npm install -g chokidar pnpm socketcluster ember-cli npm-cli-login
|
||||
|
||||
# Create application directory
|
||||
RUN mkdir -p /fleetbase
|
||||
|
||||
# Setup Console
|
||||
COPY --chown=www-data:www-data ./console /fleetbase/console
|
||||
WORKDIR /fleetbase/console
|
||||
RUN pnpm install && pnpm build
|
||||
|
||||
# Setup SocketCluster
|
||||
RUN socketcluster create /fleetbase/socketcluster
|
||||
|
||||
# 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
|
||||
ENV DB_CONNECTION=mysql
|
||||
ENV DB_HOST=127.0.0.1
|
||||
ENV DB_PORT=3306
|
||||
ENV DB_DATABASE=fleetbase
|
||||
ENV DB_USERNAME=root
|
||||
ENV DB_PASSWORD=secret
|
||||
ENV REDIS_HOST=127.0.0.1
|
||||
ENV REDIS_PORT=6379
|
||||
ENV REDIS_CLIENT=phpredis
|
||||
|
||||
# Set environment
|
||||
ARG ENVIRONMENT=production
|
||||
ENV APP_ENV=$ENVIRONMENT
|
||||
|
||||
# Setup github auth
|
||||
ARG GITHUB_AUTH_KEY
|
||||
|
||||
# Copy Caddyfile
|
||||
COPY --chown=www-data:www-data ./Caddyfile $CADDYFILE_PATH
|
||||
|
||||
# Create /fleetbase directory and set correct permissions
|
||||
RUN mkdir -p /fleetbase/api && mkdir -p /fleetbase/console && chown -R www-data:www-data /fleetbase
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /fleetbase/api
|
||||
|
||||
# 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 --no-cache"
|
||||
|
||||
# Setup application
|
||||
COPY --chown=www-data:www-data ./api /fleetbase/api
|
||||
|
||||
# Dump autoload
|
||||
RUN su www-data -s /bin/sh -c "composer dumpautoload"
|
||||
|
||||
# Setup composer root directory
|
||||
RUN mkdir -p /root/.composer
|
||||
RUN mkdir -p /fleetbase/api/.composer && chown www-data:www-data /fleetbase/api/.composer
|
||||
|
||||
# Setup logging
|
||||
RUN mkdir -p /fleetbase/api/storage/logs/ && touch /fleetbase/api/storage/logs/laravel-$(date +'%Y-%m-%d').log
|
||||
RUN chown -R www-data:www-data /fleetbase/api/storage
|
||||
RUN chmod -R 755 /fleetbase/api/storage
|
||||
|
||||
# Set permissions and run deploy script
|
||||
RUN chmod +x /fleetbase/api/deploy.sh
|
||||
# RUN sh ./fleetbase/api/deploy.sh
|
||||
|
||||
# Install go-crond
|
||||
RUN curl -L https://github.com/webdevops/go-crond/releases/download/23.12.0/go-crond.linux.amd64 > /usr/local/bin/go-crond && chmod +x /usr/local/bin/go-crond
|
||||
COPY docker/crontab ./crontab
|
||||
RUN chmod 0600 ./crontab
|
||||
|
||||
# Expose ports
|
||||
EXPOSE 8000 4200 3800 3306 6379
|
||||
|
||||
# Execute
|
||||
COPY ./docker/fullstack-entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
@@ -1,47 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
echo "🚀 Fleetbase Fullstack Container Starting..."
|
||||
|
||||
# Graceful shutdown handler
|
||||
trap 'echo "🛑 Caught termination signal, shutting down..."; kill $(jobs -p); wait' SIGTERM SIGINT
|
||||
|
||||
echo "🔧 Starting MySQL service..."
|
||||
service mysql start
|
||||
|
||||
echo "🗄️ Configuring MySQL database and user..."
|
||||
mysql --user=root <<-EOSQL
|
||||
CREATE DATABASE IF NOT EXISTS fleetbase;
|
||||
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'secret';
|
||||
FLUSH PRIVILEGES;
|
||||
EOSQL
|
||||
|
||||
echo "🧠 Waiting for MySQL to become ready..."
|
||||
until mysqladmin ping --silent; do
|
||||
echo "⏳ Waiting for MySQL..."
|
||||
sleep 1
|
||||
done
|
||||
echo "✅ MySQL is ready."
|
||||
|
||||
echo "🔧 Starting Redis service..."
|
||||
service redis-server start
|
||||
|
||||
echo "🧠 Waiting for Redis to become ready..."
|
||||
until redis-cli ping | grep -q PONG; do
|
||||
echo "⏳ Waiting for Redis..."
|
||||
sleep 1
|
||||
done
|
||||
echo "✅ Redis is ready."
|
||||
|
||||
echo "📡 Launching SocketCluster on port 3800..."
|
||||
node /fleetbase/socketcluster/index.js &
|
||||
|
||||
echo "🖥️ Serving Ember frontend on port 4200..."
|
||||
npx serve -l 4200 /fleetbase/console/dist &
|
||||
|
||||
echo "📦 Running Fleetbase deploy script..."
|
||||
sh /fleetbase/api/deploy.sh
|
||||
|
||||
echo "🧬 Starting Laravel API (FrankenPHP Octane) on port 8000..."
|
||||
cd /fleetbase/api
|
||||
exec php artisan octane:frankenphp --port=8000 --host=0.0.0.0
|
||||
Submodule packages/core-api updated: 416078f32a...04ae1ac455
Submodule packages/dev-engine updated: 23614889f5...64a379ce12
Submodule packages/ember-core updated: 8cf9fc6537...54a45bbdaa
Submodule packages/ember-ui updated: 551a42982c...c6694206e9
Submodule packages/fleetbase-extensions-indexer updated: db26b8add3...a6f2b4cde9
Submodule packages/fleetops updated: 267edc52de...09487c1c50
Submodule packages/fleetops-data updated: 5d9cc9d759...08520b3981
Submodule packages/iam-engine updated: 898b8d0d14...99698152e2
Submodule packages/pallet updated: b343c621f1...9e7592eddb
Submodule packages/storefront updated: 71b094313f...b5776acef6
Reference in New Issue
Block a user