mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 06:48:42 +02:00
Add basic docker support for development
Assuming docker engine is installed, it is now possible to run the dev server using 'docker-compose up --build' or run the production version using 'docker build -t bitburner . && docker run -it -p 8000:80 bitburner'.
This commit is contained in:
@@ -5,6 +5,7 @@ var HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
const isDevServer = (env || {}).devServer === true;
|
||||
const runInContainer = (env || {}).runInContainer === true;
|
||||
const isDevelopment = argv.mode === 'development';
|
||||
const outputDirectory = isDevServer ? "dist-dev" : "dist";
|
||||
const entries = {};
|
||||
@@ -22,6 +23,22 @@ module.exports = (env, argv) => {
|
||||
entrypoints: true,
|
||||
}
|
||||
|
||||
const devServerSettings = {
|
||||
port: 8000,
|
||||
publicPath: `/`,
|
||||
stats: statsConfig,
|
||||
};
|
||||
|
||||
// By default, the webpack-dev-server is not exposed outside of localhost.
|
||||
// When running in a container we need it accessible externally.
|
||||
if (runInContainer) {
|
||||
devServerSettings.disableHostCheck = true;
|
||||
devServerSettings.host = '0.0.0.0';
|
||||
devServerSettings.watchOptions = {
|
||||
poll: true,
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
@@ -131,11 +148,7 @@ module.exports = (env, argv) => {
|
||||
},
|
||||
},
|
||||
},
|
||||
devServer: {
|
||||
port: 8000,
|
||||
publicPath: `/`,
|
||||
stats: statsConfig,
|
||||
},
|
||||
devServer: devServerSettings,
|
||||
resolve: {
|
||||
extensions: [
|
||||
".tsx",
|
||||
|
||||
Reference in New Issue
Block a user