Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/marp 224 create dockerfile for deployment of marketplace #59

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
54461c0
Init approach
nqhoan-axonivy Jul 11, 2024
7ecd6f9
Merge branch 'develop' of https://github.com/axonivy-market/marketpla…
nqhoan-axonivy Jul 11, 2024
a9c8f26
Fix dockercompose (#29)
nqhoan-axonivy Jul 12, 2024
7a31c8f
Pimp up README
nqhoan-axonivy Jul 16, 2024
cfe3971
Merge branch 'develop' of https://github.com/axonivy-market/marketpla…
nqhoan-axonivy Jul 16, 2024
6682240
Unify code (#38)
nqhoan-axonivy Jul 18, 2024
dbd9e83
Unify code
nqhoan-axonivy Jul 18, 2024
beb7c1d
Fix CI for angular
nqhoan-axonivy Jul 18, 2024
a80797c
Fix CI UI build
nqhoan-axonivy Jul 18, 2024
73340da
Add project basedir
nqhoan-axonivy Jul 18, 2024
519e17a
Fix missing sonar report
nqhoan-axonivy Jul 18, 2024
35b495a
fix sonar
nqhoan-axonivy Jul 18, 2024
d53bcb2
try again
nqhoan-axonivy Jul 18, 2024
4b3d935
again
nqhoan-axonivy Jul 18, 2024
fe2a097
again
nqhoan-axonivy Jul 18, 2024
b2cab8d
again
nqhoan-axonivy Jul 18, 2024
ced5e75
Merge branch 'feature/MARP-224-Create-dockerfile-for-deployment-of-ma…
nqhoan-axonivy Jul 18, 2024
215561d
Merge branch 'develop' of https://github.com/axonivy-market/marketpla…
nqhoan-axonivy Jul 18, 2024
ac81ce8
Remove warning
nqhoan-axonivy Jul 18, 2024
2d70131
Introduce new input for action
nqhoan-axonivy Jul 19, 2024
d34448b
Merge branch 'develop' of https://github.com/axonivy-market/marketpla…
nqhoan-axonivy Jul 19, 2024
cb248f3
Remove manual build
nqhoan-axonivy Jul 19, 2024
a7bf9eb
Fix UI does not build
nqhoan-axonivy Jul 19, 2024
99c1436
Unify port
nqhoan-axonivy Jul 19, 2024
b3517b1
Test path
tutn-axonivy Jul 19, 2024
0b49115
Fix env with specifit char
nqhoan-axonivy Jul 19, 2024
5a24735
Merge branch 'feature/MARP-224-Create-dockerfile-for-deployment-of-ma…
nqhoan-axonivy Jul 19, 2024
cdfaada
Fix wrong synctax
nqhoan-axonivy Jul 19, 2024
5021e6a
remove with
tutn-axonivy Jul 19, 2024
2e1bfff
Merge branch 'feature/MARP-224-Create-dockerfile-for-deployment-of-ma…
tutn-axonivy Jul 19, 2024
ec66eea
Wrong syntax
nqhoan-axonivy Jul 19, 2024
baafc02
Merge branch 'feature/MARP-224-Create-dockerfile-for-deployment-of-ma…
nqhoan-axonivy Jul 19, 2024
e1efe3f
Update sonar meta
tutn-axonivy Jul 19, 2024
67155d1
Merge branch 'feature/MARP-224-Create-dockerfile-for-deployment-of-ma…
tutn-axonivy Jul 19, 2024
89004e4
update syntax
nqhoan-axonivy Jul 19, 2024
d8e67cc
Rename build
nqhoan-axonivy Jul 19, 2024
e7e4392
Add env for release
nqhoan-axonivy Jul 19, 2024
eed5875
Merge branch 'develop' of https://github.com/axonivy-market/marketpla…
nqhoan-axonivy Jul 19, 2024
8866b51
update util for local env - sonar scanner
ntqdinh-axonivy Jul 19, 2024
6324ca7
Handle feedback
nqhoan-axonivy Jul 22, 2024
2af8c42
Merge branch 'feature/MARP-224-Create-dockerfile-for-deployment-of-ma…
nqhoan-axonivy Jul 22, 2024
3edc79c
Unify folder
nqhoan-axonivy Jul 22, 2024
1f10fb5
Added revert proxy for server to avoid cors check
nqhoan-axonivy Jul 24, 2024
20d5099
Merge branch 'develop' of https://github.com/axonivy-market/marketpla…
nqhoan-axonivy Jul 24, 2024
120a64e
Resolve conflict
nqhoan-axonivy Jul 24, 2024
209ddc3
Resovlve conflict
nqhoan-axonivy Jul 24, 2024
60e4c24
Merge branch 'develop' of https://github.com/axonivy-market/marketpla…
nqhoan-axonivy Jul 24, 2024
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
13 changes: 13 additions & 0 deletions marketplace-build/config/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,25 @@ http {
include /etc/nginx/mime.types;

server {
listen 80;
server_name marketplace;

root /usr/share/nginx/html;
index index.html;

location / {
try_files $uri $uri/ /index.html;
}

location /marketplace-service {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://service:8080/marketplace-service;
proxy_ssl_session_reuse off;
proxy_set_header Host $http_host;
proxy_cache_bypass $http_upgrade;
proxy_redirect off;
}
}
}
4 changes: 2 additions & 2 deletions marketplace-build/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: marketplace

services:
mongodb:
container_name: marketplace-mongodb-7.0.0
container_name: marketplace-mongodb
build:
context: ./config/mongodb
dockerfile: Dockerfile
Expand Down Expand Up @@ -54,4 +54,4 @@ services:
- mongodb

volumes:
mongodata:
mongodata:
2 changes: 1 addition & 1 deletion marketplace-ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ RUN npm install
RUN npm run build --prod

# Stage 2: Serve Angular app using Nginx
FROM nginx:alpine
FROM nginx
COPY --from=build-angular /app/dist/browser /usr/share/nginx/html
COPY --from=assets config/nginx/nginx.conf /etc/nginx/nginx.conf
5 changes: 2 additions & 3 deletions marketplace-ui/src/app/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class AuthService {
private readonly BASE_URL = environment.apiUrl;
private readonly TOKEN_KEY = 'token';
private readonly githubAuthUrl = 'https://github.com/login/oauth/authorize';
private readonly githubAuthCallbackPath = environment.githubAuthCallbackPath;
private readonly githubAuthCallbackUrl = window.location.origin + environment.githubAuthCallbackPath;

constructor(
private readonly http: HttpClient,
Expand All @@ -38,8 +38,7 @@ export class AuthService {

redirectToGitHub(originalUrl: string): void {
const state = encodeURIComponent(originalUrl);
const githubAuthCallbackUrl = window.location.origin + this.githubAuthCallbackPath;
const authUrl = `${this.githubAuthUrl}?client_id=${environment.githubClientId}&redirect_uri=${githubAuthCallbackUrl}&state=${state}`;
const authUrl = `${this.githubAuthUrl}?client_id=${environment.githubClientId}&redirect_uri=${this.githubAuthCallbackUrl}&state=${state}`;
window.location.href = authUrl;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const apiInterceptor: HttpInterceptorFn = (req, next) => {
}
let requestURL = req.url;
const apiURL = environment.apiUrl;
if (!requestURL.startsWith(apiURL)) {
if (!requestURL.includes(apiURL)) {
requestURL = `${apiURL}/${req.url}`;
}

Expand Down
2 changes: 1 addition & 1 deletion marketplace-ui/src/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const environment = {
production: true,
apiUrl: 'http://marketplace.server.ivy-cloud.com:8080/marketplace-service',
apiUrl: '/marketplace-service',
githubClientId: 'Ov23liVMliBxBqdQ7FnG',
githubAuthCallbackPath: '/auth/github/callback',
dayInMiliseconds: 86400000
Expand Down
Loading