Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mc_frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
callidus
mc_frontend
Commits
f3ee3927
Commit
f3ee3927
authored
4 years ago
by
Konstantin Schulz
Browse files
Options
Downloads
Patches
Plain Diff
nginx is now running as a separate docker container
parent
0fe343f7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#10904
failed
4 years ago
Changes
5
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
.dockerignore
+2
-0
2 additions, 0 deletions
.dockerignore
Dockerfile
+0
-7
0 additions, 7 deletions
Dockerfile
docker-compose.yml
+17
-3
17 additions, 3 deletions
docker-compose.yml
nginx.conf
+3
-8
3 additions, 8 deletions
nginx.conf
src/index.html
+0
-15
0 additions, 15 deletions
src/index.html
with
22 additions
and
33 deletions
.dockerignore
+
2
−
0
View file @
f3ee3927
/node_modules
.git
.gitignore
This diff is collapsed.
Click to expand it.
Dockerfile
+
0
−
7
View file @
f3ee3927
...
...
@@ -3,8 +3,6 @@ FROM node:10.19.0-stretch
RUN
useradd
-ms
/bin/bash mc
WORKDIR
/home/mc
RUN
apt-get update
RUN
apt-get
-yq
install
nginx
# for testing
RUN
apt update
RUN
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
...
...
@@ -21,10 +19,5 @@ RUN npm install
COPY
. .
COPY
nginx.conf /etc/nginx/nginx.conf
RUN
install
-Dv
/dev/null /run/nginx/nginx.pid
# workaround to fix the missing binding issue for node-sass
RUN
npm rebuild node-sass
# TODO: for some reason, this does not persist?!?!??!
# RUN ionic cordova build browser --prod --release --max-old-space-size=4096
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
17
−
3
View file @
f3ee3927
...
...
@@ -5,17 +5,31 @@ services:
build
:
context
:
.
dockerfile
:
Dockerfile
command
:
nginx -g "daemon off;"
entrypoint
:
ionic cordova build browser --prod --release --max-old-space-size=4096
environment
:
-
CHROME_BIN=google-chrome
ports
:
-
"
8100:8100"
#
ports:
#
- "8100:8100"
restart
:
always
stdin_open
:
true
tty
:
true
# do not use mounted volume in combination with the node_modules directory being ignored in .dockerignore
# volumes:
# - .:/home/mc/mc_frontend
volumes
:
-
$PWD/www:/home/mc/mc_frontend/platforms/browser/www
nginx
:
command
:
nginx-debug -g "daemon off;"
image
:
nginx:alpine
ports
:
-
"
8100:80"
restart
:
always
volumes
:
-
$PWD/www:/usr/share/nginx/html
-
./nginx.conf:/etc/nginx/nginx.conf
-
./config.xml:/usr/share/nginx/html/config.xml
depends_on
:
-
mc_frontend
networks
:
default
:
external
:
...
...
This diff is collapsed.
Click to expand it.
nginx.conf
+
3
−
8
View file @
f3ee3927
# /etc/nginx/nginx.conf
user
mc
;
# Set number of worker processes automatically based on number of CPU cores.
worker_processes
auto
;
...
...
@@ -24,7 +22,7 @@ events {
http
{
server
{
listen
8
10
0
;
listen
80
;
server_name
localhost
;
#charset koi8-r;
...
...
@@ -32,7 +30,8 @@ http {
#access_log logs/host.access.log main;
location
/
{
root
/home/mc/mc_frontend/platforms/browser/www
;
root
/usr/share/nginx/html
;
# /home/mc/mc_frontend/platforms/browser/www;
index
index.html
index.htm
;
# enable CORS so the cordova files (config.xml) can be accessed from other domains
add_header
Access-Control-Allow-Origin
*
;
...
...
@@ -138,8 +137,4 @@ http {
# Sets the path, format, and configuration for a buffered log write.
access_log
/var/log/nginx/access.log
main
;
# Includes virtual hosts configs.
include
/etc/nginx/conf.d/*.conf
;
}
This diff is collapsed.
Click to expand it.
src/index.html
+
0
−
15
View file @
f3ee3927
...
...
@@ -16,21 +16,6 @@
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
/>
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black"
/>
<!-- very, very dirty hack to correct the URL for calls to "/config.xml" from the confighelper.js/cordova.js in the cordova-browser package -->
<script>
const
open
=
XMLHttpRequest
.
prototype
.
open
;
XMLHttpRequest
.
prototype
.
open
=
function
(
method
,
url
,
async
,
username
,
password
)
{
async
=
typeof
async
===
'
undefined
'
?
true
:
async
;
username
=
username
||
null
;
password
=
password
||
null
;
if
(
url
===
"
/config.xml
"
)
{
const
base
=
location
.
protocol
.
concat
(
'
//
'
).
concat
(
window
.
location
.
host
)
+
window
.
location
.
pathname
.
split
(
"
/
"
).
slice
(
0
,
-
1
).
join
(
"
/
"
);
url
=
base
+
url
;
}
return
open
.
call
(
this
,
method
,
url
,
async
,
username
,
password
);
};
</script>
<!-- H5P integration, can be called using the global H5P variable -->
<script
src=
"assets/dist/js/h5p-standalone-main.min.js"
></script>
</head>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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