Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Kotahi
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Omo Oaiya
Kotahi
Commits
21b1ed82
Commit
21b1ed82
authored
4 years ago
by
Yannis Barlas
Browse files
Options
Downloads
Patches
Plain Diff
fix(*): pass client variables to build in production
parent
a357ae5f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Dockerfile-production
+6
-0
6 additions, 0 deletions
Dockerfile-production
docker-compose.production.yml
+3
-0
3 additions, 0 deletions
docker-compose.production.yml
docker-compose.yml
+1
-1
1 addition, 1 deletion
docker-compose.yml
webpack/plugins.js
+11
-5
11 additions, 5 deletions
webpack/plugins.js
with
21 additions
and
6 deletions
Dockerfile-production
+
6
−
0
View file @
21b1ed82
...
...
@@ -22,11 +22,17 @@ ARG node_env
ARG server_protocol
ARG server_host
ARG server_port
ARG client_protocol
ARG client_host
ARG client_port
ENV NODE_ENV=$node_env
ENV SERVER_PROTOCOL=$server_protocol
ENV SERVER_HOST=$server_host
ENV SERVER_PORT=$server_port
ENV CLIENT_PROTOCOL=$client_protocol
ENV CLIENT_HOST=$client_host
ENV CLIENT_PORT=$client_port
RUN yarn pubsweet build
...
...
This diff is collapsed.
Click to expand it.
docker-compose.production.yml
+
3
−
0
View file @
21b1ed82
...
...
@@ -11,6 +11,9 @@ services:
-
server_protocol=${SERVER_PROTOCOL}
-
server_host=${SERVER_HOST}
-
server_port=${SERVER_PORT}
-
client_protocol=${CLIENT_PROTOCOL}
-
client_host=${CLIENT_HOST}
-
client_port=${CLIENT_PORT}
ports
:
-
${SERVER_PORT:-3000}:${SERVER_PORT:-3000}
environment
:
...
...
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
1
−
1
View file @
21b1ed82
...
...
@@ -21,7 +21,7 @@ services:
-
CLIENT_PORT=${CLIENT_PORT:-4000}
-
SERVER_PROTOCOL=http
-
SERVER_HOST=server
-
SERVER_PORT=3000
-
SERVER_PORT=
${SERVER_PORT:-
3000
}
volumes
:
-
./app:/home/node/app/app
-
./config:/home/node/app/config
...
...
This diff is collapsed.
Click to expand it.
webpack/plugins.js
+
11
−
5
View file @
21b1ed82
...
...
@@ -5,8 +5,8 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const
CopyWebpackPlugin
=
require
(
'
copy-webpack-plugin
'
)
const
CompressionPlugin
=
require
(
'
compression-webpack-plugin
'
)
const
HtmlWebpackPlugin
=
require
(
'
html-webpack-plugin
'
)
const
BundleAnalyzerPlugin
=
require
(
'
webpack-bundle-analyzer
'
)
.
BundleAnalyzerPlugin
//
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
//
.BundleAnalyzerPlugin
module
.
exports
=
(
opts
=
{})
=>
{
const
plugins
=
[]
...
...
@@ -38,9 +38,15 @@ module.exports = (opts = {}) => {
}
plugins
.
push
(
new
webpack
.
DefinePlugin
({
'
process.env.NODE_ENV
'
:
`"
${
opts
.
env
}
"`
,
}),
new
webpack
.
EnvironmentPlugin
([
'
NODE_ENV
'
,
'
SERVER_PROTOCOL
'
,
'
SERVER_HOST
'
,
'
SERVER_PORT
'
,
'
CLIENT_PROTOCOL
'
,
'
CLIENT_HOST
'
,
'
CLIENT_PORT
'
,
]),
)
// put dynamically required modules into the build
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment