TeamsModule moved to old repos

This commit is contained in:
Luis Fernando Molina committed 2020-11-20 19:41:19 +01:00
1 parent 2814d4307b
commit 8bf22b6bde
210 files changed

No files matched your search

@@ -0,0 +1,16 @@
# Deploying Algo Community Portal to Linux VM
Using Docker reverse-proxied by Docker-NGINX-LetsEncrypt [base setup](https://github.com/evertramos/docker-compose-letsencrypt-nginx-proxy-companion)
In project root:
```
mkdir build
cp tools/docker/deploy.yml build/deploy.yml && \
tools/docker/Dockerfile build/Dockerfile && \
tools/docker/nginx.conf build/nginx.conf && \
npm run build
cd build
docker-compose -f deploy.yml up -d
```
@@ -0,0 +1,5 @@
FROM nginx:1.15.0-alpine
RUN rm -rf /usr/share/nginx/html
COPY --chown=nginx:nginx . /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
@@ -0,0 +1,15 @@
version: '3'
services:
node:
build:
context: ./build
dockerfile: ./build/Dockerfile
environment:
- NODE_ENV=production
- VIRTUAL_HOST=algocommunity.org
- LETSENCRYPT_HOST=algocommunity.org
- LETSENCRYPT_EMAIL=barry@algocommunity.org
- VIRTUAL_PORT=80
container_name: algocommportal
expose:
- 80
@@ -0,0 +1,17 @@
events {}
http {
server {
listen 80;
root /usr/share/nginx/html;
index index.html;
location / {
include /etc/nginx/mime.types;
try_files $uri $uri/ /index.html;
}
try_files $uri $uri/ /index.html;
}
}
@@ -0,0 +1,25 @@
const pathConfig = require('./webpack.path.config')
module.exports = {
context: pathConfig.context,
entry: ['babel-polyfill', './src/index.js'],
module: {
rules: [
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' },
{
test: /\.(png|svg|jpg|gif)$/,
use: [{ loader: 'file-loader' }
]
},
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
}
]
}
}
@@ -0,0 +1,7 @@
const path = require('path')
const context = path.resolve(__dirname, '../../..')
module.exports = {
context
}
@@ -0,0 +1,66 @@
const webpack = require('webpack')
const Dotenv = require('dotenv-webpack')
const path = require('path')
const merge = require('webpack-merge')
const history = require('connect-history-api-fallback')
const convert = require('koa-connect')
const commonConfig = require('./helpers/webpack.common.config')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin')
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
module.exports = merge(commonConfig, {
mode: 'development',
devtool: 'inline-sourcemap',
output: {
path: path.resolve(__dirname, '../../build'),
filename: 'script.js'
},
plugins: [
new Dotenv({
path: '.env'
}),
new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin({ multiStep: false }),
new HtmlWebpackPlugin({
template: 'html/index.html',
alwaysWriteToDisk: true
}),
new ScriptExtHtmlWebpackPlugin({
defaultAttribute: 'async'
}),
new HtmlWebpackHarddiskPlugin()
],
module: {
rules: [
{
test: /\.js$/,
exclude: [
/(node_modules|bower_components)/,
],
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react']
}
},
{
test: /\.s?[ac]ss$/,
loader: 'style-loader!css-loader!postcss-loader!sass-loader'
}
]
},
target: 'web'
})
module.exports.serve = {
hot: {
port: 4536
},
host: 'localhost',
port: 3001,
add: (app, middleware, options) => {
app.use(convert(history()))
}
}
@@ -0,0 +1,29 @@
const path = require('path')
const nodeExternals = require('webpack-node-externals')
module.exports = {
entry: path.resolve(__dirname, './src/lib/index.js'),
output: {
path: path.resolve(__dirname, './dist/lib'),
filename: 'index.js',
library: '',
libraryTarget: 'commonjs'
},
externals: [nodeExternals()],
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react']
}
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}
]
}
}
@@ -0,0 +1,89 @@
const webpack = require('webpack')
const path = require('path')
const merge = require('webpack-merge')
const commonConfig = require('./helpers/webpack.common.config')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin')
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
const Dotenv = require('dotenv-webpack')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin
module.exports = merge(commonConfig, {
mode: 'production',
devtool: 'inline-sourcemap',
output: {
path: path.resolve(__dirname, '../../build'),
filename: 'script.js'
},
optimization: {
minimizer: [
new UglifyJsPlugin({
cache: true,
parallel: true,
sourceMap: false
}),
new OptimizeCSSAssetsPlugin({})
],
splitChunks: {
cacheGroups: {
styles: {
name: 'styles',
test: /\.css$/,
chunks: 'all',
enforce: true
}
}
}
},
plugins: [
new Dotenv(),
new MiniCssExtractPlugin({
filename: '[name].css',
chunkFilename: '[id].css'
}),
new HtmlWebpackPlugin({
template: 'html/index.html',
alwaysWriteToDisk: true
}),
new ScriptExtHtmlWebpackPlugin({
defaultAttribute: 'async'
}),
new HtmlWebpackHarddiskPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
}),
new BundleAnalyzerPlugin({
analyzerMode: 'static',
reportFilename: 'report.html'
})
],
module: {
rules: [
{
test: /\.js$/,
exclude: [
/(node_modules|bower_components)/
],
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react']
}
},
{
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
{ loader: 'css-loader', options: { importLoaders: 2 } },
'postcss-loader',
{ loader: 'sass-loader' }
]
}
]
},
target: 'web'
})