diff --git a/.gitignore b/.gitignore index 403adbc..43d9033 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,4 @@ pnpm-debug.log* *.ntvs* *.njsproj *.sln -*.sw? +*.sw? \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..89fa72f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM node:16-alpine AS builder + +WORKDIR /front + +COPY . . + +RUN npm install +RUN npm run build + +FROM nginx:1.21.6-alpine as runner + +COPY ./deploy/nginx.conf /etc/nginx/nginx.conf +COPY --from=builder /front/dist /var/www/html + + +EXPOSE 8888 \ No newline at end of file diff --git a/deploy/nginx.conf b/deploy/nginx.conf new file mode 100644 index 0000000..f2a8e1c --- /dev/null +++ b/deploy/nginx.conf @@ -0,0 +1,33 @@ +worker_processes 1; +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; +events { + worker_connections 1024; +} +http { + include 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; + keepalive_timeout 65; + gzip_static on; + server { + listen 8888; + server_name localhost; + charset utf-8; + location / { + root /var/www/html; + try_files $uri /index.html; + etag on; + expires max; + add_header Cache-Control public; + location = /index.html { + expires 0; + add_header Cache-Control "no-cache, public, must-revalidate, proxy-revalidate"; + } + } + } +} \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index 7c39ec2..ae5725f 100644 --- a/vue.config.js +++ b/vue.config.js @@ -16,6 +16,7 @@ module.exports = defineConfig({ pugRule.uses.clear(); pugRule.oneOfs.clear(); }, + parallel: false, configureWebpack: { module: {