Created
June 18, 2020 18:34
-
-
Save onlurking/5b7bce93db596deaa70a7bfcd72faeed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 9000 default_server; | |
server_name localhost; | |
location / { | |
root /var/www/html; | |
try_files $uri $uri/ /index.html; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build stage | |
FROM node:12.16.1-alpine as build-stage | |
WORKDIR /app | |
# add `/app/node_modules/.bin` to $PATH | |
ENV PATH /app/node_modules/.bin:$PATH | |
COPY package.json package-lock.json* ./ | |
RUN npm install | |
COPY . . | |
RUN npm run build | |
# production stage | |
FROM nginx:1.17.8-alpine as production-stage | |
COPY devops/docker/nginx.conf /etc/nginx/nginx.conf | |
COPY devops/docker/default.conf /etc/nginx/conf.d/default.conf | |
COPY --from=build-stage /app/dist /var/www/html | |
COPY start.sh /usr/local/bin/start.sh | |
EXPOSE 9000 | |
CMD ["start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user nginx; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
sendfile off; | |
keepalive_timeout 60; | |
include /etc/nginx/conf.d/*.conf; | |
# gzip settings | |
gzip on; | |
gzip_disable "msie6"; | |
gzip_vary on; | |
gzip_proxied any; | |
gzip_comp_level 6; | |
gzip_buffers 32 16k; | |
gzip_http_version 1.1; | |
gzip_min_length 250; | |
gzip_types image/jpeg image/bmp image/svg+xml text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript image/x-icon; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
set -e | |
nginx -g 'daemon off;' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment