builds for docker
This commit is contained in:
parent
2ef78f47a9
commit
acd02deb08
12
Dockerfile
12
Dockerfile
@ -1,4 +1,3 @@
|
|||||||
### STAGE 1: Build ###
|
|
||||||
# defining version of the base image
|
# defining version of the base image
|
||||||
FROM node:alpine as build
|
FROM node:alpine as build
|
||||||
|
|
||||||
@ -6,15 +5,16 @@ FROM node:alpine as build
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# copying the json files into the image
|
# copying the json files into the image
|
||||||
COPY package*.json ./
|
COPY package*.json .
|
||||||
|
COPY patch-webpack.js .
|
||||||
|
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
# copying rest of project
|
# copying rest of project
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# running build script
|
# running build script
|
||||||
RUN npm run build --prod
|
RUN npm run build:prod
|
||||||
|
|
||||||
### STAGE 2: Setup ###
|
### STAGE 2: Setup ###
|
||||||
# defining nginx image version
|
# defining nginx image version
|
||||||
@ -27,8 +27,8 @@ RUN rm -rf /usr/share/nginx/html/*
|
|||||||
COPY --from=build /app/dist/cic-staff-client /usr/share/nginx/html
|
COPY --from=build /app/dist/cic-staff-client /usr/share/nginx/html
|
||||||
|
|
||||||
# copy nginx configuration file
|
# copy nginx configuration file
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
COPY nginx.conf /etc/nginx/
|
||||||
|
|
||||||
EXPOSE 80 443
|
EXPOSE 80
|
||||||
|
|
||||||
CMD [ "nginx", "-g", "daemon off;" ]
|
CMD [ "nginx", "-g", "daemon off;" ]
|
||||||
|
47
nginx.conf
47
nginx.conf
@ -1,8 +1,41 @@
|
|||||||
server {
|
|
||||||
listen 80;
|
user nginx;
|
||||||
location / {
|
worker_processes 1;
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html index.htm;
|
error_log /var/log/nginx/error.log warn;
|
||||||
try_files $uri $uri/ /index.html =404;
|
pid /var/run/nginx.pid;
|
||||||
}
|
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
http {
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
|
||||||
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||||
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||||
|
|
||||||
|
access_log /var/log/nginx/access.log main;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
#tcp_nopush on;
|
||||||
|
|
||||||
|
keepalive_timeout 65;
|
||||||
|
|
||||||
|
#gzip on;
|
||||||
|
|
||||||
|
include /etc/nginx/conf.d/*.conf;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
location / {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html index.htm;
|
||||||
|
try_files $uri $uri/ /index.html =404;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,10 +36,6 @@ function setConfigs(configs): void {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!process.env.CIC_REGISTRY_ADDRESS) {
|
|
||||||
console.error(colors.red('All the required environment variables were not provided!'));
|
|
||||||
process.exit(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isProduction) {
|
if (isProduction) {
|
||||||
console.log(colors.cyan('Running in production environment!'));
|
console.log(colors.cyan('Running in production environment!'));
|
||||||
|
Loading…
Reference in New Issue
Block a user