add Dockerfile
parent
06c7cd01b3
commit
cdbd809a0a
|
@ -0,0 +1 @@
|
|||
.gitignore
|
|
@ -1,30 +1,23 @@
|
|||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# IDEs
|
||||
.idea
|
||||
*.iml
|
||||
.vscode
|
||||
.atom
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
# NPM
|
||||
node_modules
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
# Production
|
||||
build
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
# Sensitive data
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
# Miscellaneous
|
||||
.DS_Store
|
||||
*.log*
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
FROM node:16-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install app dependencies
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
|
||||
# Build the app
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:1.20-alpine AS server
|
||||
|
||||
COPY --from=builder /app/dist/ usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
@ -0,0 +1,18 @@
|
|||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name localhost;
|
||||
|
||||
gzip on;
|
||||
gzip_types text/html text/plain text/css text/xml text/javascript application/javascript application/x-javascript;
|
||||
gzip_min_length 1024;
|
||||
gzip_vary on;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
error_page 404 /404.html;
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
}
|
Loading…
Reference in New Issue