Add docker
This commit is contained in:
16
Dockerfile
Normal file
16
Dockerfile
Normal file
@@ -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
|
||||
33
deploy/nginx.conf
Normal file
33
deploy/nginx.conf
Normal file
@@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ module.exports = defineConfig({
|
||||
pugRule.uses.clear();
|
||||
pugRule.oneOfs.clear();
|
||||
},
|
||||
parallel: false,
|
||||
|
||||
configureWebpack: {
|
||||
module: {
|
||||
|
||||
Reference in New Issue
Block a user