Skip to content

Commit 3508b31

Browse files
committed
fixed docker image
1 parent b24d25c commit 3508b31

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
FROM node:12 as build-stage
1+
FROM node:18 as build-stage
2+
23
WORKDIR /app
3-
COPY package*.json ./
4-
RUN npm install
54
COPY . .
5+
RUN npm install
66
RUN npm run build
77

88
FROM nginx:1.17
9-
COPY --from=build-stage /app/dist/ /usr/share/nginx/html
9+
10+
COPY nginx.conf /etc/nginx/conf.d/default.conf
11+
RUN rm /usr/share/nginx/html/50x.html /usr/share/nginx/html/index.html
12+
COPY --from=build-stage /app/dist/grades-application-m120/ /usr/share/nginx/html

nginx.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
server {
2+
listen 80;
3+
listen [::]:80;
4+
root /usr/share/nginx/html;
5+
index index.html;
6+
7+
location / {
8+
try_files $uri /index.html;
9+
}
10+
}

src/app/app-routing.module.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const routes: Routes = [
1212
{ path: 'home', component: HomeComponent},
1313
{ path : 'edit/:id', component : GradesOverviewComponent},
1414
{ path : 'reset/:otp', component : PasswordResetConfirmComponent},
15+
{ path : "", redirectTo : "/login"},
1516
];
1617
@NgModule({
1718
imports: [RouterModule.forRoot(routes)],

0 commit comments

Comments
 (0)