Commit 2ba0fbae authored by Dipayan Gupta's avatar Dipayan Gupta
Browse files

Fixing the MIME type issue

parent 7325ff3f
node_modules
dist
.git
.gitignore
\ No newline at end of file
.gitignore
#Building
#FROM node:12.7-alpine AS build
#WORKDIR /usr/src/webin-portal
#COPY package.json package-lock.json ./
#RUN npm install
#COPY . .
#RUN npm run build
# Running
#FROM nginx:1.17.1-alpine
#COPY nginx.conf /etc/nginx/nginx.conf
#COPY --from=build /usr/src/webin-portal/dist/webin-portal /usr/share/nginx/html
# Stage 0, "build-stage", based on Node.js, to build and compile the frontend
FROM node:12.7-alpine as build-stage
WORKDIR /app
COPY package*.json /app/
### STAGE 1: Build ###
FROM node:12.7-alpine AS build
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm install
COPY ./ /app/
COPY . .
ARG configuration=production
RUN npm run build -- --output-path=./dist/out --configuration $configuration
# Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx
FROM nginx:1.15
#Copy ci-dashboard-dist
COPY --from=build-stage /app/dist/out/ /usr/share/nginx/html
#Copy default nginx configuration
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
RUN npm run build -- --configuration $configuration
### STAGE 2: Run ###
FROM nginx:1.17.1-alpine
COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=build /usr/src/app/dist/webin-portal /usr/share/nginx/html
COPY --from=build /usr/src/app/dist/webin-portal /usr/share/nginx/html/ena/submit/webin
#events{}
#http {
#include /etc/nginx/mime.types;
#server {
#listen 80;
# server_name localhost;
# root /usr/share/nginx/html;
# index index.html;
#
# location / {
# try_files $uri $uri/ /index.html;
# }
#}
#}
events{}
http {
server {
index index.html index.htm;
include /etc/nginx/mime.types;
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location ~ \.js {
add_header Content-Type text/javascript;
}
}
}
# Expires map
map $sent_http_content_type $expires {
default off;
text/html epoch;
text/css max;
application/json max;
application/javascript max;
~image/ max;
}
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
expires $expires;
gzip on;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment