Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules
.git
.github
.env
.env.*
!.env.example
public/js
public/css
coverage
*.log
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM node:20-alpine AS build-stage
FROM node:22-alpine AS build-stage

WORKDIR /app

# set CI environment variable for pnpm
ENV CI=true
# ESLint flat config is ESM; babel-eslint-parser needs this on Node 22
ENV NODE_OPTIONS=--experimental-require-module

# install build dependencies and CA certificates
RUN apk add --no-cache \
Expand All @@ -12,7 +14,7 @@ RUN apk add --no-cache \

# install application dependencies
COPY package.json pnpm-lock.yaml ./
RUN corepack enable && pnpm install --frozen-lockfile
RUN corepack enable && corepack prepare pnpm@9.15.9 --activate && pnpm install --frozen-lockfile

# copy in application source
COPY . .
Expand All @@ -30,7 +32,7 @@ RUN pnpm build
RUN pnpm install --frozen-lockfile --prod

# copy built application to runtime image
FROM node:20-alpine
FROM node:22-alpine
WORKDIR /app

# install CA certificates in runtime image
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"start": "./bin/www",
"start-dev": "nodemon --ignore public/ ./bin/www | pino-pretty",
"jest": "env $(grep -v '^#' .env.example | grep -v '^$' | tr \"\\\\n\" \" \") NODE_OPTIONS=--experimental-vm-modules jest",
"lint": "eslint",
"lint": "NODE_OPTIONS=--experimental-require-module eslint",
"lint-fix": "eslint --fix",
"test": "pnpm run lint && pnpm run jest",
"test:smtp": "node test-smtp-config.js",
Expand Down Expand Up @@ -85,7 +85,7 @@
"@babel/runtime": "^7.25.0",
"@marsidev/react-turnstile": "^1.0.2",
"@reduxjs/toolkit": "^2.2.7",
"@steemit/steem-js": "^1.0.11",
"@steemit/steem-js": "^1.0.16",
"nodemailer": "^6.9.8",
"body-parser": "^1.20.2",
"express": "^4.19.2",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions webpack/empty-undici.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Stub for steem-js browser bundle: node:undici is only used server-side with custom TLS.
export class Agent {
constructor() {}
}
39 changes: 18 additions & 21 deletions webpack/makeConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ function makePlugins(options) {

let plugins = [
new webpack.DefinePlugin({
'process.env.NODE_ENV':
isDevelopment
? JSON.stringify('development')
: JSON.stringify('production'),
'process.env.NODE_ENV': isDevelopment
? JSON.stringify('development')
: JSON.stringify('production'),
}),
new webpack.NormalModuleReplacementPlugin(
/^node:undici$/,
join(__dirname, 'empty-undici.js')
),
new WebpackManifestPlugin({
fileName: '../manifest.json',
publicPath: '/js/',
Expand Down Expand Up @@ -109,10 +112,7 @@ function makeStyleLoaders(options) {
return [
{
test: /\.css$/,
use: [
'style-loader',
'css-loader',
],
use: ['style-loader', 'css-loader'],
},
{
test: /\.less$/,
Expand All @@ -136,10 +136,7 @@ function makeStyleLoaders(options) {
return [
{
test: /\.css$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
],
use: [MiniCssExtractPlugin.loader, 'css-loader'],
},
{
test: /\.less$/,
Expand All @@ -161,7 +158,7 @@ function makeStyleLoaders(options) {
}

function makeConfig(options) {
if (!options) options = {}
if (!options) options = {};
_defaults(options, DEFAULTS);

const isDevelopment = options.isDevelopment;
Expand All @@ -174,15 +171,18 @@ function makeConfig(options) {
},
mode: isDevelopment ? 'development' : 'production',
entry: {
app: (
isDevelopment ? ['webpack-hot-middleware/client?reload=true'] : []
app: (isDevelopment
? ['webpack-hot-middleware/client?reload=true']
: []
).concat([join(options.baseDir, 'src/index.js')]),
},
output: {
path: join(options.baseDir, '/public/js'),
publicPath: '/js',
filename: isDevelopment ? '[name].js' : '[name].[chunkhash:5].js',
chunkFilename: isDevelopment ? '[id].chunk.js' : '[id].chunk.[chunkhash:5].js',
chunkFilename: isDevelopment
? '[id].chunk.js'
: '[id].chunk.[chunkhash:5].js',
clean: true,
},
plugins: makePlugins(options),
Expand All @@ -198,17 +198,14 @@ function makeConfig(options) {
use: {
loader: 'babel-loader',
options: {
plugins: [
isDevelopment && ReactRefreshBabel,
].filter(Boolean),
plugins: [isDevelopment && ReactRefreshBabel].filter(Boolean),
},
},
},
{
test: /\.json$/,
type: 'json',
parser: {
},
parser: {},
},
{
test: /\.(eot|ttf|woff|woff2)(\?.+)?$/,
Expand Down
Loading