Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
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
idatt2106-2024-07
frontend
Commits
eaaf50cd
Commit
eaaf50cd
authored
1 year ago
by
Henrik
Browse files
Options
Downloads
Patches
Plain Diff
fix: fix 20
parent
23c644a9
Branches
fix/small-bugs
No related tags found
1 merge request
!91
Feat/deployment
Pipeline
#283855
passed
1 year ago
Stage: docker_build_and_push
Stage: deploy_docker
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Dockerfile
+1
-0
1 addition, 0 deletions
Dockerfile
web/nginx.conf
+14
-32
14 additions, 32 deletions
web/nginx.conf
with
15 additions
and
32 deletions
Dockerfile
+
1
−
0
View file @
eaaf50cd
...
...
@@ -9,5 +9,6 @@ RUN npm run build
# Step 2: Setup the server with Nginx
FROM
nginx:stable-alpine
as
production-stage
COPY
--from=build-stage /app/dist /usr/share/nginx/html
COPY
web/nginx.conf /etc/nginx/nginx.conf
EXPOSE
5173
CMD
["nginx", "-g", "daemon off;"]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
web/nginx.conf
+
14
−
32
View file @
eaaf50cd
# Frontend server configuration
server
{
listen
443
ssl
;
server_name
sparesti.org
;
# Main domain for the frontend
worker_processes
auto
;
ssl_certificate
/etc/ssl/certs/nginx-selfsigned.crt
;
ssl_certificate_key
/etc/ssl/private/nginx-selfsigned.key
;
error_log
/var/log/nginx/error.log
notice
;
pid
/var/run/nginx.pid
;
location
/
{
proxy_pass
http://vue-frontend:80
;
# Adjust the port and container name as necessary
proxy_set_header
Host
$host
;
proxy_set_header
X-Real-IP
$remote_addr
;
proxy_set_header
X-Forwarded-For
$proxy_add_x_forwarded_for
;
proxy_set_header
X-Forwarded-Proto
$scheme
;
}
events
{
worker_connections
1024
;
}
# API server configuration
server
{
listen
443
ssl
;
server_name
api.sparesti.org
;
# API subdomain
http
{
include
/etc/nginx/mime.types
;
ssl_certificate
/etc/ssl/certs/nginx-selfsigned.crt
;
ssl_certificate_key
/etc/ssl/private/nginx-selfsigned.key
;
server
{
listen
5173
;
server_name
localhost
;
location
/
{
proxy_pass
http://spring-backend:8080
;
# Adjust the port and container name as necessary
proxy_set_header
Host
$host
;
proxy_set_header
X-Real-IP
$remote_addr
;
proxy_set_header
X-Forwarded-For
$proxy_add_x_forwarded_for
;
proxy_set_header
X-Forwarded-Proto
$scheme
;
location
/
{
root
/usr/share/nginx/html
;
try_files
$uri
$uri
/
/index.html
;
}
}
}
# HTTP to HTTPS redirection for main domain and subdomain
server
{
listen
80
;
server_name
sparesti.org
api.sparesti.org
;
return
301
https://
$host$request_uri
;
}
\ No newline at end of file
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