mirror of
https://github.com/fleetbase/fleetbase.git
synced 2026-01-07 15:01:45 +00:00
Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
196af155ae | ||
|
|
056a717d08 | ||
|
|
fd008d7f73 | ||
|
|
451c95d0f0 | ||
|
|
b267b303cf | ||
|
|
441b4f3f0c | ||
|
|
0e4d4a7c8c | ||
|
|
24392527e0 | ||
|
|
c19d838757 | ||
|
|
3a072c1524 | ||
|
|
0c96386cf1 | ||
|
|
708babb81c | ||
|
|
8c8acf1e43 | ||
|
|
e853e2ca22 | ||
|
|
dacaff37ca | ||
|
|
b0460963e5 | ||
|
|
9ec786d892 | ||
|
|
76859aeb26 | ||
|
|
1764b804de | ||
|
|
0c33018b5b | ||
|
|
72b1b9b764 | ||
|
|
aee552f518 | ||
|
|
9967f27c83 | ||
|
|
21ecfb5d93 | ||
|
|
579a369888 | ||
|
|
b06830990c | ||
|
|
a7c4aba512 | ||
|
|
a625f37e14 | ||
|
|
cce1699a75 | ||
|
|
6338820372 |
20
.github/workflows/cd.yml
vendored
20
.github/workflows/cd.yml
vendored
@@ -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@v2
|
||||
- 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
6
.gitmodules
vendored
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,12 +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
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Caddyfile.console
Normal file
19
Caddyfile.console
Normal 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
|
||||
}
|
||||
@@ -163,4 +163,4 @@ Get updates on Fleetbase's development and chat with the project maintainers and
|
||||
|
||||
# License & Copyright
|
||||
|
||||
Code and documentation copyright 2018–2023 the <a href="https://github.com/fleetbase/fleetbase/graphs/contributors">Fleetbase Authors</a>. Code released under the <a href="https://github.com/fleetbase/storefront-app/blob/main/LICENSE.md">MIT License</a>.
|
||||
Fleetbase is made available under the terms of the <a href="https://www.gnu.org/licenses/agpl-3.0.html" target="_blank">GNU Affero General Public License 3.0 (AGPL 3.0)</a>. For other licenses <a href="mailto:hello@fleetbase.io" target="_blank">contact us</a>.
|
||||
|
||||
@@ -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.10",
|
||||
"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": {
|
||||
|
||||
841
api/composer.lock
generated
841
api/composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -23,3 +23,6 @@ php artisan schedule-monitor:sync
|
||||
|
||||
# Clear cache
|
||||
php artisan cache:clear
|
||||
|
||||
# Initialize registry
|
||||
php artisan registry:init
|
||||
|
||||
54
console/Dockerfile.server-build
Normal file
54
console/Dockerfile.server-build
Normal 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;"]
|
||||
@@ -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;"]
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ConsoleExtensionsRoute extends Route {}
|
||||
@@ -1,12 +0,0 @@
|
||||
{{page-title "Extensions"}}
|
||||
<Layout::Section::Body class="overflow-y-scroll h-full pt-6">
|
||||
<div class="container mx-auto h-screen space-y-4">
|
||||
<div class="flex flex-col items-center justify-center pt-14 px-40">
|
||||
<FaIcon @icon="shapes" @size="4x" class="mb-6 text-blue-500" />
|
||||
<h1 class="dark:text-gray-100 text-black text-4xl font-bold mb-4">{{t "console.extensions.title"}}</h1>
|
||||
<p class="dark:text-gray-300 text-black text-lg">
|
||||
{{t "console.extensions.message"}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</Layout::Section::Body>
|
||||
@@ -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: {
|
||||
@@ -40,6 +41,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'),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
module.exports = function () {
|
||||
return {
|
||||
'free-solid-svg-icons': 'all',
|
||||
'free-brands-svg-icons': 'all',
|
||||
};
|
||||
};
|
||||
|
||||
11
console/config/utils/as-array.js
Normal file
11
console/config/utils/as-array.js
Normal 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 [];
|
||||
};
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@fleetbase/console",
|
||||
"version": "0.4.27",
|
||||
"version": "0.5.2",
|
||||
"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.10",
|
||||
"@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
25384
console/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,6 @@ Router.map(function () {
|
||||
});
|
||||
this.route('console', { path: '/' }, function () {
|
||||
this.route('home', { path: '/' });
|
||||
this.route('extensions');
|
||||
this.route('notifications');
|
||||
this.route('account', function () {
|
||||
this.route('virtual', { path: '/:slug/:view' });
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from '@fleetbase/console/tests/helpers';
|
||||
|
||||
module('Unit | Route | console/extensions', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it exists', function (assert) {
|
||||
let route = this.owner.lookup('route:console/extensions');
|
||||
assert.ok(route);
|
||||
});
|
||||
});
|
||||
@@ -1,5 +1,3 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
cache:
|
||||
image: redis:4-alpine
|
||||
@@ -39,15 +37,15 @@ services:
|
||||
REDIS_URL: tcp://cache
|
||||
|
||||
console:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: console/Dockerfile.server-build
|
||||
args:
|
||||
ENVIRONMENT: development
|
||||
ports:
|
||||
- "4200:4200"
|
||||
volumes:
|
||||
- ./console:/app/console
|
||||
build:
|
||||
context: .
|
||||
dockerfile: console/Dockerfile
|
||||
args:
|
||||
ENVIRONMENT: development
|
||||
- console-build:/console
|
||||
|
||||
application:
|
||||
build:
|
||||
@@ -57,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
|
||||
@@ -72,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
|
||||
@@ -85,3 +89,6 @@ services:
|
||||
- "8000:80"
|
||||
depends_on:
|
||||
- application
|
||||
|
||||
volumes:
|
||||
console-build:
|
||||
@@ -1,9 +1,9 @@
|
||||
# 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 \
|
||||
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 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
|
||||
|
||||
# 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
|
||||
@@ -55,7 +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
|
||||
RUN mkdir -p /fleetbase/api && mkdir -p /fleetbase/console && chown -R www-data:www-data /fleetbase
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /fleetbase/api
|
||||
@@ -63,11 +71,14 @@ 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
|
||||
@@ -119,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"]
|
||||
|
||||
Submodule packages/core-api updated: 4567b4a193...f6a1345600
Submodule packages/dev-engine updated: 206bdb5406...c7136ce4c6
Submodule packages/ember-core updated: 82d2e57938...1ed4989719
Submodule packages/ember-ui updated: fa277fd1b3...255c35e57b
Submodule packages/fleetops updated: 8b52c1fc07...65f667d557
Submodule packages/iam-engine updated: 4e25379a1b...7d0a1ff025
1
packages/ledger
Submodule
1
packages/ledger
Submodule
Submodule packages/ledger added at 1f6f27f501
Submodule packages/pallet updated: 9d87fc26fe...424446db0e
1
packages/registry-bridge
Submodule
1
packages/registry-bridge
Submodule
Submodule packages/registry-bridge added at 9bdedfd4be
Submodule packages/storefront updated: 845eba683c...f148c4fee0
Reference in New Issue
Block a user