prettify nginx, dockerfile updates

This commit is contained in:
willyb321
2018-07-26 08:33:05 +10:00
parent 5f70d283e0
commit 78134404c3
3 changed files with 46 additions and 35 deletions

View File

@@ -24,7 +24,6 @@ RUN npm start
WORKDIR /src/app/coriolis WORKDIR /src/app/coriolis
RUN git fetch --all RUN git fetch --all
RUN git reset --hard origin/$BRANCH RUN git reset --hard origin/$BRANCH
RUN rm -rf node_modules/
RUN npm install --no-package-lock RUN npm install --no-package-lock
RUN npm run build RUN npm run build
@@ -33,5 +32,6 @@ RUN npm run build
FROM nginx:1.13.12-alpine as web FROM nginx:1.13.12-alpine as web
COPY nginx.conf /etc/nginx/nginx.conf COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /src/app/coriolis/build /usr/share/nginx/html COPY --from=builder /src/app/coriolis/build /usr/share/nginx/html
WORKDIR /usr/share/nginx/html
EXPOSE 80 EXPOSE 80
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-c", "/etc/nginx/nginx.conf", "-g", "daemon off;"]

View File

@@ -5,8 +5,8 @@ services:
build: build:
dockerfile: coriolis/.docker/Dockerfile dockerfile: coriolis/.docker/Dockerfile
context: ../.. context: ../..
environment: args:
BRANCH: master branch: master
restart: always restart: always
networks: networks:
- coriolis_web - coriolis_web
@@ -22,9 +22,13 @@ services:
build: build:
dockerfile: coriolis/.docker/Dockerfile dockerfile: coriolis/.docker/Dockerfile
context: ../.. context: ../..
args:
branch: master
restart: always restart: always
environment: volumes:
BRANCH: feature/docker-deployment - ./nginx.conf:/etc/nginx/nginx.conf
ports:
- 8090:80
networks: networks:
- coriolis_web - coriolis_web
- default - default

View File

@@ -1,27 +1,34 @@
user nobody; worker_processes 1;
worker_processes auto; # it will be determinate automatically by the number of core user nobody nobody;
error_log /tmp/error.log;
error_log /var/log/nginx/error.log warn; pid /tmp/nginx.pid;
#pid /var/run/nginx.pid; # it permit you to use /etc/init.d/nginx reload|restart|stop|start
events { events {
worker_connections 1024; worker_connections 1024;
} }
http { http {
include /etc/nginx/mime.types; include /etc/nginx/mime.types;
default_type application/octet-stream; default_type application/octet-stream;
sendfile on; sendfile on;
access_log /var/log/nginx/access.log; client_body_temp_path /tmp/client_body;
fastcgi_temp_path /tmp/fastcgi_temp;
proxy_temp_path /tmp/proxy_temp;
scgi_temp_path /tmp/scgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
access_log /tmp/access.log;
error_log /tmp/error.log;
keepalive_timeout 3000; keepalive_timeout 3000;
server { server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
index index.html; index index.html;
server_name localhost; server_name localhost;
root /usr/share/nginx/html; root /usr/share/nginx/html;
autoindex on;
location ~* \.(?:manifest|appcache|html?|xml|json|css|js|map|jpg|jpeg|gif|png|ico|svg|eot|ttf|woff|woff2)$ { location ~* \.(?:manifest|appcache|html?|xml|json|css|js|map|jpg|jpeg|gif|png|ico|svg|eot|ttf|woff|woff2)$ {
expires -1; expires -1;