Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kszkepzes-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Köpeczi-Bócz Gergely
kszkepzes-frontend
Commits
ece6ccd1
Commit
ece6ccd1
authored
4 years ago
by
Rafael László
Browse files
Options
Downloads
Patches
Plain Diff
replace npm serve with nginx
parent
b6a64856
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+18
-2
18 additions, 2 deletions
.gitlab-ci.yml
Dockerfile
+5
-15
5 additions, 15 deletions
Dockerfile
nginx.conf
+61
-0
61 additions, 0 deletions
nginx.conf
package.json
+1
-2
1 addition, 2 deletions
package.json
with
85 additions
and
19 deletions
.gitlab-ci.yml
+
18
−
2
View file @
ece6ccd1
image
:
node:latest
variables
:
CONTAINER_IMAGE
:
'
registry.kszk.bme.hu/kszk/devteam/$CI_PROJECT_NAME:$CI_COMMIT_REF_NAME'
stages
:
-
Pre Build
-
Docker Build
PreBuild
:
stage
:
Pre Build
tags
:
[
docker
]
image
:
node:latest
script
:
-
npm install
-
npm run build
cache
:
paths
:
-
build/
artifacts
:
expire_in
:
1 day
paths
:
-
build/
only
:
-
tags
Docker build
:
stage
:
Docker Build
tags
:
[
docker
]
...
...
This diff is collapsed.
Click to expand it.
Dockerfile
+
5
−
15
View file @
ece6ccd1
FROM
n
ode:10-alpine
FROM
n
ginx:1.19.2
WORKDIR
/opt/app
ENV
TZ Europe/Budapest
RUN
apk add
--no-cache
tzdata
&&
ln
-snf
/usr/share/zoneinfo/
$TZ
/etc/localtime
&&
echo
$TZ
>
/etc/timez
on
e
# copy the files builded with npm run build
COPY
build /var/www
COPY
nginx.conf /etc/nginx/nginx.c
on
f
# Copying application files
COPY
./src ./src
COPY
./public ./public
COPY
package.json package-lock.json ./
# Installing dependencies
RUN
npm
install
RUN
npm
install
serve
# Running
EXPOSE
3000
ENTRYPOINT
["npm", "run", "deploy"]
ENTRYPOINT
["nginx","-g","daemon off;"]
This diff is collapsed.
Click to expand it.
nginx.conf
0 → 100644
+
61
−
0
View file @
ece6ccd1
# auto detects a good number of processes to run
worker_processes
auto
;
#Provides the configuration file context in which the directives that affect connection processing are specified.
events
{
# Sets the maximum number of simultaneous connections that can be opened by a worker process.
worker_connections
8000
;
# Tells the worker to accept multiple connections at a time
multi_accept
on
;
}
http
{
# what times to include
include
/etc/nginx/mime.types
;
# what is the default one
default_type
application/octet-stream
;
# Sets the path, format, and configuration for a buffered log write
log_format
compression
'
$remote_addr
-
$remote_user
[
$time_local
]
'
'"
$request
"
$status
$upstream_addr
'
'"
$http_referer
"
"
$http_user_agent
"'
;
server
{
# listen on port 80
listen
3000
;
# save logs here
access_log
/var/log/nginx/access.log
compression
;
# where the root here
root
/var/www
;
# what file to server as index
index
index.html
index.htm
;
location
/
{
# First attempt to serve request as file, then
# as directory, then fall back to redirecting to index.html
try_files
$uri
$uri
/
/index.html
;
}
# Media: images, icons, video, audio, HTC
location
~
*
\
.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)
$
{
expires
1M
;
access_log
off
;
add_header
Cache-Control
"public"
;
}
# Javascript and CSS files
location
~
*
\
.(?:css|js)
$
{
try_files
$uri
=
404
;
expires
1y
;
access_log
off
;
add_header
Cache-Control
"public"
;
}
# Any route containing a file extension (e.g. /devicesfile.js)
location
~
^.+\..+$
{
try_files
$uri
=
404
;
}
}
}
This diff is collapsed.
Click to expand it.
package.json
+
1
−
2
View file @
ece6ccd1
...
...
@@ -28,8 +28,7 @@
"start"
:
"react-scripts start"
,
"build"
:
"react-scripts build"
,
"test"
:
"react-scripts test --env=jsdom"
,
"eject"
:
"react-scripts eject"
,
"deploy"
:
"serve -l 3000 -s build"
"eject"
:
"react-scripts eject"
},
"devDependencies"
:
{
"
eslint
"
:
"
6.8.0
"
,
...
...
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