Compare commits

..

5 Commits
dev ... master

Author SHA1 Message Date
36c8713f46 image embed with og protocol updated 2025-06-18 19:53:20 +02:00
45d1abccfe update dockerfile and nginx config 2025-06-18 11:33:01 +02:00
8771bbd9ca update for prod deployment 2025-06-18 10:10:27 +02:00
15655a6a25 Merge branch 'dev' 2025-06-18 10:01:18 +02:00
47c769813d Actualiser README.md 2025-04-09 10:04:55 +02:00
6 changed files with 45 additions and 13 deletions

View File

@ -1,10 +1,9 @@
FROM node:alpine
FROM nginx:alpine
WORKDIR /usr/src/app
COPY ./dist/review-front/browser /usr/share/nginx/html
COPY . /usr/src/app
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
RUN npm install -g @angular/cli
RUN npm install
EXPOSE 80
CMD ["ng", "serve", "--host", "0.0.0.0"]
CMD ["nginx", "-g", "daemon off;"]

View File

@ -11,8 +11,13 @@
- [ ] Terminer l'interface admin
- [x] Bug (de temps en temps) pour stocker les données utilisateur
avant de run le docker
```
npm i
ng build --configuration=production
```
pour run le docker :
```
sudo docker build -t abonentendeur .
sudo docker run -d -p 4200:4200 abonentendeur
sudo docker build -t abonentendeur-prod .
sudo docker run -d -p 4200:80 abonentendeur-prod
```

View File

@ -38,13 +38,13 @@
"budgets": [
{
"type": "initial",
"maximumWarning": "500kB",
"maximumError": "1MB"
"maximumWarning": "2MB",
"maximumError": "3MB"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kB",
"maximumError": "4kB"
"maximumWarning": "100kB",
"maximumError": "200kB"
}
],
"outputHashing": "all"
@ -101,5 +101,8 @@
}
}
}
},
"cli": {
"analytics": false
}
}

13
nginx.conf Normal file
View File

@ -0,0 +1,13 @@
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html index.htm;
location / {
try_files $uri $uri/ /index.html;
}
error_page 404 /index.html;
}

View File

@ -17,6 +17,7 @@ import {Button} from 'primeng/button';
import {DialogModule} from 'primeng/dialog';
import {AuthService} from '../../auth.service';
import {Role} from '../../models/role';
import {Meta} from '@angular/platform-browser';
@Component({
selector: 'app-post',
@ -46,7 +47,7 @@ export class PostComponent {
private postService: PostService,
private commentService: CommentService,
private messageService: MessageService,
private authService: AuthService,) {
private authService: AuthService) {
this.route.paramMap.subscribe(params => {
if (!(this.authService.isSessionExpired()) && this.authService.isAuthenticated()) {
const authenticatedAuthor = this.authService.getAuthenticatedAuthor();
@ -81,6 +82,14 @@ export class PostComponent {
});
}
cutDesc(desc: string): string {
let output: string = '';
for (let i = 0; i < 256; i++) {
output += desc[i];
}
return output;
}
addNewCommentToList(comment: Comment) {
this.comments.push(comment);
console.log(this.comments)

View File

@ -5,6 +5,9 @@
<meta charset="utf-8">
<title>A BON ENTENDEUR</title>
<base href="/">
<meta property="og:title" content="À bon entendeur">
<meta property="og:description" content="Un blog où je partage mon avis sur différentes oeuvres...">
<meta property="og:image" content="https://abonentendeur.guams.fr/assets/icon.png">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="icon.png">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">