mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-21 21:47:17 +00:00
* separate dockerfile for tooljet client in development mode * production dockerfile for tooljet client * reference the tooljet clients dev dockerfile in the docker-compose file * use a fallback url for API_URL in cases where TOOLJET_SERVER_URL is not defined * nginx config file for the front-end * docker-compose file for production deploys * dont run postgres inside docker-compose * use an entrypoint script for setting the server host for nginx * separate volume for fallback certs * add docs for docker-compose deployment * add required database keys in the .env.example file * address review comments
72 lines
1.5 KiB
JavaScript
72 lines
1.5 KiB
JavaScript
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
const path = require('path');
|
|
|
|
const environment = process.env.NODE_ENV === 'production' ? 'production' : 'development';
|
|
|
|
const API_URL = {
|
|
production: process.env.TOOLJET_SERVER_URL || '/_backend_',
|
|
development: 'http://localhost:3000'
|
|
};
|
|
|
|
const ASSET_PATH = {
|
|
production: 'https://app.tooljet.io/',
|
|
development: '/public/'
|
|
};
|
|
|
|
module.exports = {
|
|
mode: 'development',
|
|
resolve: {
|
|
extensions: ['.js', '.jsx']
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.ttf$/,
|
|
use: ['file-loader']
|
|
},
|
|
{
|
|
test: /\.jsx?$/,
|
|
loader: 'babel-loader'
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
loader: 'style-loader!css-loader'
|
|
},
|
|
{
|
|
test: /\.scss$/,
|
|
use: [{
|
|
loader: 'style-loader'
|
|
}, {
|
|
loader: 'css-loader'
|
|
}, {
|
|
loader: 'sass-loader'
|
|
}]
|
|
}
|
|
]
|
|
},
|
|
resolve: {
|
|
extensions: ['.js', '.jsx', '.png'],
|
|
alias: {
|
|
'@': path.resolve(__dirname, 'src/')
|
|
}
|
|
},
|
|
plugins: [new HtmlWebpackPlugin({
|
|
template: './src/index.html'
|
|
})],
|
|
devServer: {
|
|
historyApiFallback: true
|
|
},
|
|
output: {
|
|
publicPath: '/',
|
|
path: path.resolve(__dirname, 'build')
|
|
},
|
|
externals: {
|
|
// global app config object
|
|
config: JSON.stringify({
|
|
apiUrl: API_URL[environment],
|
|
assetPath: ASSET_PATH[environment],
|
|
GOOGLE_MAPS_API_KEY: process.env.GOOGLE_MAPS_API_KEY,
|
|
SERVER_IP: process.env.SERVER_IP
|
|
})
|
|
}
|
|
};
|